-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix cp38-macosx universal2 and arm64 Python pkg URL #1169
Conversation
Previous URL pointed to x86_64 version
Unfortunately we don't want to upgrade the bundled Python because it would increase the minimum MacOS version for the x86_64 arch from 10.9 to 11.0, which is a pretty massive jump. |
Sorry, could you please explain how arm64 Python URL affects x86_64 minimum macOS version? |
{ identifier = "cp38-macosx_arm64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" }, | ||
{ identifier = "cp38-macosx_universal2", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" }, | ||
{ identifier = "cp38-macosx_arm64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg" }, | ||
{ identifier = "cp38-macosx_universal2", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg" }, |
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.
here you update also python to build universal2 wheels. universal2
wheels are wheels that contain code for both x86 and arm. This python version does not allow to build wheels against x86 for macos 10.9.
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.
Should I update arm64 URL only?
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.
I still don't understand, sorry. For Python 3.9 and 3.10 both arm64 and universal2 URLs points to universal2 packages, while all python 3.8 URLs are for the x86_64 package. Why is it different for different Python versions?
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.
I do not play too much with ARM on macOS so let's wait for what @joerick will tell.
Ah, I understand what's going on. We still have no arm64 CI, so we've never actually had a chance to test running all this on arm64. The version of 3.8 that we install only runs on x86_64. So when you run it on arm64, it's emulating x86_64. The wheel that you built is fine, but you're not able to test it. This PR seems to only change the universal2/arm64 build identifiers. I don't think that will change anything, as on macOS you can only have one minor version of Python installed at once, and the first one that cibuildwheel finds, it will install. So if we were going to make this change we'd have to change all three 3.8 URLs. The Python 3.8 arm64 support was added in #704. I don't have time right now but perhaps there are some clues in there why we're not using the |
We tried very hard to use this when it came out, but it doesn’t work. CPython only has partial support for 3.8 on ARM - it was squeezed in at the last minute in the last binary release. IIRC you can’t produce 10.9-10.15 compatible wheels for Intel from the ARM version since Python didn’t include a 10.9 compatible Intel version in the binary, like they normally do (and do in 3.9+). You can look at the PR where 3.8 was added, I think. I think to make this “work” we’d need to special case when running on ARM and have the (big) caveat that you can’t build for macOS 10 from AS (but only for 3.8). Is 3.8 still the version Apple ships? I’m traveling and won’t be my AS machine till the 27th. |
Read here:
I think we should see if we can build from AS too, but we haven’t had CI runners for it and it will take some changes and should error out of macOS version is set <11. I’m pretty sure we use the AS version from this table when building pure AS wheels from Intel. |
Now that |
From what I understand, you can't set |
yes. here is a |
Thanks all for the informative discussion. I guess the upshot is that we keep the macos10.9 installer, and we can't test 3.8 arm64 wheels, even when running on arm64. However, we should change the behaviour when running on Apple Silicon, to not try to test the arm64 3.8 wheel, and include an informative message explaining why. |
Per discussion in pypa#1169, the default installer used for cp38 is an Intel installer. It makes sense to skip testing arm64 wheels in this case. However, if the user choose to manually install the universal2 CPython version, then, tests shall be run on arm64. This allows users that either target 11.0+ on intel, universal2 or only build for arm64 to get the arm64 wheel tested on AppleSilicon.
Per discussion in pypa#1169, the default installer used for cp38 is an Intel installer. It makes sense to skip testing arm64 wheels in this case. However, if the user choose to manually install the universal2 CPython version, then, tests shall be run on arm64. This allows users that either target 11.0+ on intel, universal2 or only build for arm64 to get the arm64 wheel tested on AppleSilicon.
Per discussion in pypa#1169, the default installer used for cp38 is an Intel installer. It makes sense to skip testing arm64 wheels in this case. However, if the user choose to manually install the universal2 CPython version, then, tests shall be run on arm64. This allows users that either target 11.0+ on intel, universal2 or only build for arm64 to get the arm64 wheel tested on AppleSilicon.
- not testable due to cpython38 constraints (pypa/cibuildwheel#1169)
- not testable due to cpython38 constraints (pypa/cibuildwheel#1169)
Just a note for anyone finding this now that arm64 runners are more widely available. If it's important to you to test the cp38 arm64 wheels, there's a workaround. You can choose to install a different version of Python 3.8 on your runner before invoking cibuildwheel: curl -fsSLO https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg
sudo installer -pkg python-3.8.10-macos11.pkg -target /
# ... invoke cibuildwheel ... Just be aware that if you use this Python to build x86_64 wheels too, this increases the minimum supported macOS version on x86_64 to 11.0. |
For reference, this gives an idea of which Python 3.8 users are using which OS. That's the last 30 days, from our stats spreadsheet |
Do you have your old python versions the last month plot? That was interesting to see the fraction of 3.8 ARM users. I also don't remember what the default Python version was for those versions. I'm on the latest macOS and I see 3.9 in my |
I don't think they do, I don't think there's an open source 2.7 for AS, and homebrew doesn't offer 2.7 anymore. But Apple provided their own patched version in macOS 11 - 12.3. |
Previous URLs pointed to x86_64 version