-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
BLD: Add support for building iOS wheels #28759
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
base: main
Are you sure you want to change the base?
Conversation
Thanks @freakboy3742. This looks pretty clean. The |
And update; after discussions on the mesonbuild/meson-python#731, some additional changes to meson (mesonbuild/meson#14541) and CPython (python/cpython#133184) were identified. I'm working on getting those changes upstreamed. |
cibuildwheel 3.0 out. :) |
Awesome! A new meson-python release is only remaining blocker. |
bf0802b
to
b57ba57
Compare
Status update: With the current main branch of meson-python, numpy/meson#22 applied to the meson-python branch, and the current main branch of cibuildwheel, this passes the full test suite on iOS under both Python 3.13 and 3.14. The changes to the test suite changes involve:
On top of those changes, there's one specific change to ctypes handling to account for the odd way that iOS handles dynamic loading, and one workaround for a pytest issue (related to getuser() and the creation of temporary files). |
numpy/testing/_private/utils.py
Outdated
# getuser() tries to use `pwd`, which doesn't exist on iOS. Fake a | ||
# username that will take priority. | ||
if IS_IOS: | ||
os.environ["USER"] = "iOSUser" |
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.
This workaround isn't required if you use pytest 8.1.0 or higher, as the underlying problem was fixed by pytest-dev/pytest#11875
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've removed this workaround by bumping pytest to 8.4.1.
The test changes seem fine to me. |
I've added CI workflows, and updated cibuildwheel and vendored-meson versions; the meson-python release is the only outstanding TODO. I've updated the description of the PR to reflect current status, and a couple of notable design decisions. |
Adds iOS as a test and release target for NumPy.
UPDATE: 30 July 2025 This PR is almost ready for review. PR body reflects current status.
In an environment where:
This branch will build and test accelerated iOS device and simulator wheels:
The build will also work without the
IPHONEOS_DEPLOYMENT_TARGET
definition, but with an unaccelerated version of blas (this is the analog of theMACOSX_DEPLOYMENT_TARGET=14.0
configuration, except that there isn't a pre-compiled openBLAS for iOS to fall back on).Other notable details of this PR:
macos-13
runner starting September 1, and themacos-13
runner is the last x86_64 runner available on GitHub Actions.FWIW, macos-13 runner issue will also impact the workflows producing x86_64 macOS wheels. I don't know what (if any) decisions have been made about NumPy's support for macOS on x86_64, but adding new iOS workflows using macOS-13 a month or two before the runner is deprecated seemed ill-advised.