Skip to content

Inconsistent wrapping of before-build/before-test for Rosetta on macOS #2592

@rgommers

Description

@rgommers

With the deprecation of the GHA macos-13 runner images, which are the last ones to support Intel Macs, it will become more common for people to try to build x86-64 wheels on macOS arm64. When trying this for NumPy, I found that the before-build, before-test, test-command, etc. hooks are inconsistently wrapped for Rosetta usage (i.e., prepending -arch x86_64`):

This is a problem, as a pip install somepkg in before-build may happily succeed while installing an arm64 package, which will cause a problem in next steps by either failing or silently doing the wrong thing. Here is a passing CI job for a numpy cp311-macosx_x86_64 wheel where the before-build phase installs scipy-openblas64 for arm64 which then goes missing from the final wheel (the build linked Accelerate instead).

I'd think that the expected behavior is for before-build and before-test to be wrapped in the same way.

Alternatively, it should be documented that this isn't done. One could then manually work around it and install an x86-64 package like so:

pip install scipy-openblas64 --platform macosx_10_13_x86_64 --only-binary :all: --target $(python -c "import os; print(f'{os.path.dirname(os.__file__)}/site-packages')")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions