Repository navigation
fix(macos): build wheels for macOS 11+ instead of macOS 15+ - #29
Merged
Merged
Conversation
The published macOS wheels were tagged `macosx_15_0` because CI set MACOSX_DEPLOYMENT_TARGET=15.0 and bundled Homebrew's PCRE2 (a bottle compiled for the runner's macOS 15). Both the extension and the bundled `libpcre2-8.0.dylib` carried `minos 15.0`, so `pip install extxyz` failed on macOS 11-14 with "no compatible version" / a dyld load error — which is what a user on macOS arm64 hit when installing into a Python 3.12 (mamba) env. Fix: on macOS, build a static PCRE2 from source at the wheel's deployment target (11.0, the oldest arm64 macOS) and link it into `_extxyz.so` via PKG_CONFIG_PATH, instead of using the Homebrew bottle. The resulting wheel ships only the extension module (no vendored dylib), is tagged `macosx_11_0`, and loads on macOS 11+. - tools/wheels/build_pcre2_macos.sh: static PCRE2 build (jit, PIC) at target - pyproject.toml: use the script in before-all; set MACOSX_DEPLOYMENT_TARGET and PKG_CONFIG_PATH in [tool.cibuildwheel.macos.environment] - build-wheels.yml: drop the conflicting CIBW_ENVIRONMENT_MACOS override (a single env var would replace, not merge with, the pyproject environment table) - subprojects/pcre2.wrap: refresh to WrapDB pcre2_10.44-2 (the pinned -1 patch hash had gone stale, which broke the meson subproject fallback used by source/standalone builds) Verified locally with cibuildwheel (cp312-macosx_arm64): 264 KB wheel, `_extxyz.so` minos 11.0, PCRE2 statically linked, test suite passes, installs and imports under Python 3.12. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
Published macOS wheels required macOS 15+ (
macosx_15_0), sopip install extxyzfailed on macOS 11–14 with "no compatible version" / a dyld load error. Reported by a user on macOS arm64 / Python 3.12 installing into a mamba env.Root cause (verified against the live PyPI wheel): CI set
MACOSX_DEPLOYMENT_TARGET=15.0and bundled Homebrew's PCRE2 bottle (compiled for the runner's macOS), so both_extxyz.soand the bundledlibpcre2-8.0.dylibcarriedminos 15.0. Lowering only the env var is insufficient — the Homebrew dylib stays pinned to the runner's macOS (a realcibuildwheelrun fails delocation; on a current runner Homebrew PCRE2 isminos 26.0).Fix
On macOS, build a static PCRE2 from source at the wheel's deployment target and link it into
_extxyz.so(viaPKG_CONFIG_PATH) instead of bundling Homebrew's bottle.tools/wheels/build_pcre2_macos.sh— static PCRE2 (JIT + PIC) atMACOSX_DEPLOYMENT_TARGET.pyproject.toml—before-allruns the script;MACOSX_DEPLOYMENT_TARGET=11.0+PKG_CONFIG_PATHin[tool.cibuildwheel.macos.environment].build-wheels.yml— drop theCIBW_ENVIRONMENT_MACOSoverride (a single env var would replace, not merge with, the pyproject environment table, silently droppingPKG_CONFIG_PATH).subprojects/pcre2.wrap— refresh to WrapDBpcre2_10.44-2; the pinned-1patch hash had gone stale, which had separately broken the meson subproject fallback for source/standalone builds.Verification (local cibuildwheel, committed config only)
cp312-macosx_arm64→ 264 KB wheel containing only_extxyz.so:minos 11.0, PCRE2 statically linked (nothing vendored, nopcre2grep/headers leaking into user envs), test suite passes during build, installs + imports under Python 3.12.🤖 Generated with Claude Code