Repository navigation
ci: build x86_64 macOS wheels (cross-compiled on arm64) so Intel Macs never build from source - #32
Merged
Merged
Conversation
Intel Macs had no wheel and fell back to the sdist, which needs CMake and a C++ compiler at install time. GitHub has no Intel macOS runner any more, so cibuildwheel now builds both x86_64 and arm64 on macos-latest: x86_64 is cross-compiled via ARCHFLAGS (which scikit-build-core maps to CMAKE_OSX_ARCHITECTURES) and its bundled-library test runs under Rosetta 2. x86_64 wheels target macOS 10.13 (10.15 for CPython 3.14+); arm64 stays 11.0. A new check script runs lipo/otool on the dylib in every macOS wheel and fails if its architecture or minimum macOS disagrees with the wheel tag. A new wheels.yml builds and checks the macOS wheels on PRs that touch the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NDx6PbBsjPuycBAhTwC6Ho
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Intel Macs had no wheel and installed from the sdist, which compiles the library at install time (needs CMake + a C++ compiler). The NDI installer will depend on pyraview, so an Intel Mac user must get a pre-built wheel.
What
pyproject.toml:[tool.cibuildwheel.macos] archs = ["x86_64", "arm64"]gives separate per-arch wheels. I didn't use universal2 because I found no reason to make every Mac download twice as big. GitHub has no Intel runner, so x86_64 is cross-compiled on the arm64macos-latestrunner: cibuildwheel exportsARCHFLAGS=-arch x86_64, which scikit-build-core maps toCMAKE_OSX_ARCHITECTURES. The bundled-librarytest-commandstill runs for every x86_64 wheel, under Rosetta 2 (arch -x86_64). Notest-skipwas needed.MACOSX_DEPLOYMENT_TARGET=10.13, the oldest target current Xcode supports and what CPython 3.12+ needs anyway. cibuildwheel raises it to 10.15 for CPython 3.14+, and logs a warning saying so. arm64 stays 11.0..github/scripts/check_macos_wheel_arch.shunzips every macOS wheel and runslipo -archs/otool -l/fileon the bundled dylib. It fails if the library's architecture differs from the wheel tag's (in either direction), or if itsminosis newer than the tag claims. It runs inrelease.ymlafter cibuildwheel on macOS, and in the new workflow below..github/workflows/wheels.yml(onpull_request, path-filtered to the C/Python sources, CMakeLists, pyproject, the workflows and the script; plusworkflow_dispatch): builds, tests and arch-checks the macOS wheels for both archs exactly as the release does.test.ymlhas no cibuildwheel job, so this is the PR-time proof.release.ymlcomment and the README; Intel Macs are no longer told to build from source.Results (CI on this PR, cibuildwheel 4.3.1,
macos-latestarm64)macOS wheel tags produced (18):
macosx_10_13_x86_64macosx_11_0_arm64macosx_10_15_x86_64macosx_11_0_arm64Minimum macOS: 10.13 High Sierra on Intel (10.15 Catalina for Python 3.14+), 11.0 Big Sur on Apple Silicon. Each library's
LC_BUILD_VERSION minosmatches its tag.How the architecture was verified:
libpyraview.dylibas[x86_64](Mach-O 64-bit dynamically linked shared library x86_64) and every arm64 wheel as[arm64], all 18ok.arch -x86_64 /bin/sh -c 'python -c ...'in an x86_64 venv. Each run printedbundled: .../venv-test-x86_64/.../pyraview/libpyraview.dylib, so an x86_64 Python actually loaded the bundled library.--require-archscheck also passed.MATLAB toolbox (investigated; not changed here)
Intel-Mac MATLAB users are affected. The macOS MEX is built only on the arm64
macos-15runner (R2025a), and the v0.4.1 release shipspyraview.mexa64,pyraview.mexmaca64andpyraview.mexw64, with nopyraview.mexmaci64. On Intel-Mac MATLAB the toolbox has no binary. The auto-download fallback inpyraview.mthen requestsreleases/latest/download/pyraview.mexmaci64, which doesn't exist, so users get the "could not download" error. The standalonepyraview-macOS-ARM64.zipis arm64-only too. #33 addresses the MEX separately.Out of scope and unchanged: PyPI publishing, py3-none wheels, Windows ARM64, the MATLAB jobs.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NDx6PbBsjPuycBAhTwC6Ho