build py_limited_api abi3 wheel and MacOS universal2 wheel#186
Conversation
|
Hmm, cibuildwheel didn't produce a universal2 wheel. |
|
There is no universal2 wheel for CPython 3.6. The first Apple Silicon version of Python is 3.9. There's a small chance 3.8 might be back ported, possibly? But it's 3.9 only for now. |
| - run: cibuildwheel | ||
| - uses: joerick/cibuildwheel@v1.9.0 | ||
| env: | ||
| CIBW_BUILD: cp36-* |
There was a problem hiding this comment.
| CIBW_BUILD: cp36-* | |
| CIBW_BUILD: cp36-* cp39-macosx_universal2 |
Hopefully I got the name right, we forgot to add it to our table. 😳
There was a problem hiding this comment.
I'm curious to see if this a) produces a reasonably named wheel, and b) is correctly loaded by Pip; supporting 10.9 universal was something they forgot to consider, cp36 universal sounds like something that might be easy to miss, too. :)
There was a problem hiding this comment.
You can also add CIBW_TEST_SKIP: *universal2:arm64 to keep cibuildwheel from complaining about having to skip testing the arm64 part of a universal2 wheel.
There was a problem hiding this comment.
Looks like that change worked, there's now a universal2 wheel in the artifact. Need to find someone with a compatible Mac to test what pip does.
There was a problem hiding this comment.
Well, by "worked" I mean it built MarkupSafe-2.0.0a1-cp36-abi3-macosx_10_9_universal2.whl, which hopefully only gets picked for 3.9 by pip...
|
Had someone test it on their M1 Mac, and it doesn't look like pip understands the combination of abi3 and universal2 right now. Steps were:
When they used an x86 Python: |
|
What version of pip? You have to have pip 21.0.1 to get universal wheels to install on M1 Macs. This would not surprise me if missing, though. I don't think homebrew ships 21.0.1 yet. |
|
I just messaged them asking for |
|
Homebrew does ship pip 21.0.1, as long as they updated in the last nine days it should be 21.0.1. I'll have an M1 starting Thursday. |
|
They upgraded pip and it now picked the correct wheel: So it looks like we should be good to build cp36-abi3 and universal2. |
|
Fantastic! You really need pip 21.0.1+ on M1. |
use limited api to build one wheel for 3.6+ use cibuildwheel action build mac universal2 wheel
3e41771 to
b982d71
Compare
|
I merged this then realized we are still having issues with Windows #175 (comment) |
|
What happened with Windo... Oh, I see you noticed that. Was curious to see how it was solved when I saw it was merged. :/ |
|
As a workaround, you could make the Limited API conditional, disabled on Windows, but it really should work. Not involved enough in Windows to really help here, though. :( |
|
Can you try deleting all the distutils import and overrides? That bothers me; a) you shouldn't be touching distutils, it's being removed in 3.12, and b) setuptools should always be imported first, and c) it doesn't really seem to be doing anything very useful anyway, at least as far as I can see. |
|
Ahh, it allows the build to fail but then be ignored. Still think you could just catch the normal error, though? |
|
The important stuff does come from setuptools, so that's shouldn't be it, I wouldn't think. |
|
I tried getting rid of the custom command class and just catching the exceptions directly, but something else in distutils/setuptools/pip catches them first and the exceptions don't make it back to the top-level code. |
|
But to answer the implied question, the custom command isn't resulting in the bad Windows build, it still fails to import even when I remove all the custom stuff. |
|
Rolling the abi3 part back, as our use of Python's Unicode API is not compatible with |
Use py_limited_api to build one wheel for 3.6+. Currently testing this.
Use cibuildwheel as a GitHub action. Don't need
setup-pythonorpip install.Build a MacOS universal2 wheel. From what I could tell from the cibuildwheel docs, this seems to be preferred over building the arm64 wheel.
closes #175