-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cross-compiling #10
Conversation
3e47ec1
to
77f51e8
Compare
This fix uses the 'setup.cfg' file used by setuptools to define parameters for cross-compiling. The reason for using this config file is that command-line parameters can't be passed to setup.py, as the command-line is ideally opaque to the installer. 'setup.cfg' was added to setuptools as a useful middle-ground between modifying 'setup.py' and the command line. Now, build systems can modify a config file instead of the source directly.
77f51e8
to
3de44d8
Compare
This new option should allow users to build the module in a cross-compilation scenario, where the host's platform is not the target's. This is a different way of implementing the idea shown in #10. Signed-off-by: Rodrigo Tobar <[email protected]>
Hi, Thanks for showing interest in the package, and for highlighting the problem of cross-compilation. In principle I think the idea is good, but I'm not convinced this is the best approach. First, it requires the I've pushed a commit in a new |
I was unaware of how build_ext fit into the picture. This is much nicer! I'll try your patch now. |
Using your patch and a modified bitbake recipe, this builds for arm successfully. When I do
Which goes away when I set I've only tried importing on arm. Let me know if there's a python command I should try running. |
Thanks for letting me know that it works with the alternative solution. I take it you don't have a problem with me using that instead of yours then. Regarding the I think you would agree with me that the discussion about this importing behavior is separate from this pull request though, so I'll be closing this now. |
This is exactly how it should be. Thanks for helping me get cross compiling working! |
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]>
Do not poke at build system for finding platform platform is target specific and when cross compiling it should be detected differently, in this case lets pass it via environment so that it can be set in recipe Looks like we're not the first to need to specify the target platform [1] when building this package. According to upstream, we can just update setup.cfg instead of patching setup.py. [1] ICRAR/crc32c#10 Signed-off-by: Justin Bronder <[email protected]> Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]>
Description
When packaging crc32c for OpenEmbedded, I hit a build error. Cross-compiling fails because setup.py assumes it's running on the build machine. However, setup.py treats the command line as an opaque string, so we can't pass build system parameters normally.
Fortunately, setuptools uses a file called setup.cfg to set parameters. I added support for machine configuration in a new build system section.
How has this been tested?
I created an OpenEmbedded recipe for crc32c:
Without the patch, I get this error:
Then I apply the patch, and append this to my recipe:
After the patch, crc32c can be used in the completed build.