-
-
Notifications
You must be signed in to change notification settings - Fork 183
Add cross-builds for ARM #59
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
Conversation
The last one should be fixed now. |
Thank you for following up on our email thread and contributing this! As we discussed on that thread, my request was for you to contribute something quick and dirty that produced working results and I would figure out a path to incorporating it into this project so it could coexist with existing code. From a quick glance at this PR, I believe you've done that! I can't land this PR as is because the changes to the base Docker image would break the existing builds. But, there is plenty in here to build a working integration from. I'll definitely look at incorporating this the next time I set down to hack on python-build-standalone (which could be several weeks away). In the interim, if you want to incrementally add parts of your patch as separate PRs that can be landed without breaking existing builds, go for it! I think a good place to start would be to teach the The goal here would be to incrementally decrease the size of the diff to support ARM so that the scope of work required to implement that in a robust manner is as small as possible. If you want to submit these incremental PRs, go for it. Otherwise I'll rework this PR the next time I sit down to hack on this project. Thank you again for the contribution! Can't wait to incorporate this and get cross-builds working! |
You're welcome! I'm in no particular hurry to land this. I've got what I needed - a portable Python distro for ARM. Feel free to massage this PR into the shape you like when you have time.
Curiously enough, building on xenial did not change the compatibility list that |
Forgot another todo item:
|
Oh, nice! FWIW the reason I use Debian as the base image is that http://snapshot.debian.org/ provides point-in-time snapshots of the Apt package repository. By pointing the environment at a specific snapshot, we ensure that |
Debian Stretch might work as well; I went for Ubuntu Xenial just because it seemed to have a slightly lower version of glibc (2.23 vs 2.24). |
I started incorporating parts of this patch into the Essentially, I've got a parallel branch of yours going in my local development environment and I'm slowly porting pieces over as I grok them. I'm not sure when I'll finish this. Don't feel obliged to rebase and work through the merge conflicts if you don't want to! |
5ae72f7
to
d00340d
Compare
6fcdc3b
to
e40c9c7
Compare
a3c4068
to
02d9ac6
Compare
@indygreg I've tried rebasing this branch on top of your main, but there are lots of conflicts. :( You've added arm arch to the docker image, so I was wondering whether you are planning to enable Linux cross-builds anytime soon? |
I was experimenting with Linux ARM cross-compiles a few days ago. It is something I'd very much like to implement. I may look at it again in the days ahead. |
I just pushed some cross-compiling support. See #60 (comment) and https://python-build-standalone.readthedocs.io/en/latest/status.html#target-notes for more context. The code in this PR was very helpful in implementing cross-compiling support. First for Apple targets then Linux. Thank you for helping to steer me in the right direction! |
Thanks! |
Clang is likely required for cross builds on Apple targets. GCC might be possible. But I have no intention of trying to get that working... because Apple. Only the i686 cross builds are currently using Clang, everything else is using the gcc crosstools packages in Debian Stretch. However, I would like to get everything using Clang if possible that way we have a single compiler for all UNIX-like platforms. Is there a good reason to use GCC over Clang? If there is, we should consider using a more modern GCC. Debian Stretch is version 6.3. Sticking with 6.3 is probably fine. I just like keeping things modern. Everything else is using a modern toolchain. |
Oh, sorry, I actually meant to ask "why aren't you using clang to cross build...", but accidentally the most important word in the sentence :) |
This enables cross-building for aarch64-unknown-linux-gnu and arm-unknown-linux-gnueabihf.
Because Python runs various scripts in the course of install image generation, a host arch Python distribution needs to be built first.
Areas that still need work:
(
PYTHONHOME=$(pwd)/install LD_LIBRARY_PATH=$(pwd)/install/lib $(pwd)/install/bin/python3 build/run_tests.py
from the root of extracted zstd package).I could not get the pip module to work on arm -python3 -m ensurepip
fails because of missing _sysconfigdata__linux_aarch64-linux-gnu module. Not sure why it isn't getting built...