Skip to content

Conversation

@rgommers
Copy link
Member

The macos-13 image is deprecated, meaning GitHub Actions no longer offers x86-64 runners. Hence we need to cross compile. Cibuildwheel runs the tests under Rosetta2, and that works fine once we skip a couple of problematic cases.

A few of the changes in the macOS section were simple cleanups to bring things back in sync with the numpy-release repo. E.g., the F77/F90 env vars were distutils-specific and no longer used, and the DYLD_LIBRARY_PATH usage was also unnecessary.

Closes gh-29728

Opened as Draft PR because the .pc file handling needs cleaning up and it's not yet 100% clear if cibuildwheel won't change how this works (xref pypa/cibuildwheel#2592).

The macos-13 image is deprecated, meaning GitHub Actions no longer
offers x86-64 runners. Hence we need to cross compile. Cibuildwheel
runs the tests under Rosetta2, and that works fine once we skip a
couple of problematic cases.

A few of the changes in the macOS section were simple cleanups
to bring things back in sync with the `numpy-release` repo.
E.g., the F77/F90 env vars were distutils-specific and no longer used,
and the `DYLD_LIBRARY_PATH` usage was also unnecessary.
# We're cross compiling; the before-build hook isn't using Rosetta (see cibuildwheel#2592)
mkdir host-env
python -m pip install -r $PROJECT_DIR/requirements/ci_requirements.txt --platform macosx_10_13_x86_64 --only-binary :all: -U --target ./host-env
# Use a handwritten .pc file, because we can't run the cross Python to generate it
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab instead of spaces - needs fixing

@@ -0,0 +1,12 @@
libdir=/Users/runner/work/numpy/numpy/host-env/scipy_openblas64/lib
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be generated by a script. The problem with scipy-openblas is that it has a function to generate the .pc file, but it relies on dlopen-ing the shared library, which won't work for cross builds.

@andyfaff
Copy link
Member

@rgommers please accept my apology, I thought it would be easier to do that this. cibuildwheel takes care of this for me for my personal project, but that doesn't use meson/etc and is a lot simpler.

@rgommers
Copy link
Member Author

@andyfaff no worries at all, no need to apologize. If things "just work" it's natural to assume it will do so for numpy too. It took me a little while to even understand what cibuildwheel is doing, since its docs don't explain it and I thought it was doing a native emulated build rather than a cross build. Either way, we'd have some troubles with it though. And SciPy will too - I think a cross build is actually nicer for SciPy.

@agriyakhetarpal
Copy link
Contributor

@rgommers, in pypa/cibuildwheel#2601 I've changed the images to use the new macos-15-intel ones, so that we can perform native macOS Intel builds for some more time. I hope that helps!

P.S. Probably by the time GitHub deprecates support for these images (a couple of years, perhaps), support for the platform in general would be at its twilight. I suppose the cross-compilation experiment here is still worth trying, of course – for other platform/architecture combos, if not macOS ARM ➡️ macOS Intel.

@andyfaff
Copy link
Member

MacOS Intel runners on 15, awesome. Didn't know about that.

@andyfaff
Copy link
Member

andyfaff commented Oct 7, 2025

@rgommers, I think this can be closed as the macos-15-intel runners should be able to build the wheel. #29886 is effectively a (native) superset of this PR which should be merged instead of this.

I think we should stop making macosx-x86_64 when the macos-15-intel image is retired.

@rgommers
Copy link
Member Author

rgommers commented Oct 7, 2025

Agreed - great news on the new runner images, so we can close this.

@rgommers rgommers closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: macos-13 runner image deprecated, drops macOS x86-64 support

3 participants