Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork249
Add patch for Apple cross compilation on 3.13+#323
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
zanieb commentedSep 7, 2024
@indygreg could you give me some context on testing this since it's not needed for CI to pass? |
indygreg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You test this by passing--target-triple to./build-macos.py targeting the non-native target. So from Apple Silicon you want--target-triple x86_64-apple-darwin to cross-compile to x86-64. A working build is almost certainly sign of success.
To test from CI, you could switch the macOS runners to a new/old version to force cross-compiles. PGO and BOLT would stop working. But it otherwise shouldjust work.
zanieb commentedSep 8, 2024
Ah okay that makes sense — I was wondering why CI didn't cross compile if we were patching for it and thought maybe this was for some other target. This fails for me:
I'll play with the patch some more. |
indygreg commentedSep 8, 2024
CPython's build system has historically made some questionable decisions about how to build on/for Apple platforms. e.g. they've historically not supported cross-compiling (unless doing a multi-arch "universal" build) despite cross-compiling for Apple platforms being probably one of the easiest platforms to cross-compile for! My guess is they tweaked more configure checks in this area (possibly as part of shoring up iOS support) and created more work for us in the process. We don't need to support cross-compiles anymore. Historically I needed it because GitHub Actions didn't have macOS ARM runners. At the moment we have x86-64 and ARM macOS runners and all is well. |
zanieb commentedSep 8, 2024
It actually is really nice to be able to cross-compile so I can test the x86_64 builds from my laptop. Our builds are also slowed down by GitHub's concurrent macOS job limit (only 5). There are alternative platforms that provide macOS runners that would let us have a higher concurrency limit, but they only support ARM. I'll probably try to fix it slowly. |
030f947 to99d223eComparezanieb commentedSep 8, 2024
Alright turned out to be pretty easy, works locally. |
Uh oh!
There was an error while loading.Please reload this page.
Following up on#319 — adds a patch to support cross-compilation as we do for previous Python versions.