ci: fix Windows builds under CMake 4, build universal2 macOS wheels#245
Open
danceratopz wants to merge 2 commits into
Open
ci: fix Windows builds under CMake 4, build universal2 macOS wheels#245danceratopz wants to merge 2 commits into
danceratopz wants to merge 2 commits into
Conversation
The VS2019 image now ships CMake >= 4, which rejects the cmake_minimum_required(VERSION < 3.5) declared by Hunter 0.24.0's CMake scripts, so every VS2019 job fails at the test configure step (Hunter is only used for the test dependencies). Set CMAKE_POLICY_VERSION_MINIMUM=3.5 as an environment variable: unlike a -D option it also reaches Hunter's child cmake invocations and the packages it builds. CMake < 4 ignores it, so the VS2017 jobs are unaffected.
CircleCI's macOS runners are Apple silicon now, so the macos-release job produces arm64-only wheels tagged for the runner's OS (macosx_14_0). Cross-compile the wheel as universal2 (x86_64 + arm64) instead and set MACOSX_DEPLOYMENT_TARGET=11.0, so a single wheel covers every arm64 Mac and Intel Macs on Big Sur or newer. The architecture flags are exported for both compile steps: CMAKE_OSX_ARCHITECTURES for the cmake build of the static libraries and ARCHFLAGS/CFLAGS/LDFLAGS for the cffi extension; _PYTHON_HOST_PLATFORM makes the wheel platform tag match. The x86_64 slice is cross-compiled and not executed in CI.
Collaborator
Author
|
Looks like the relevant bits of CI passed. |
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.
Two independent CI fixes for the wheel-building infrastructure, one commit each.
appveyor: fix VS2019 builds under CMake 4
All VS2019 jobs currently fail at the test configure step: the image now ships CMake >= 4, which rejects the
cmake_minimum_required(VERSION < 3.5)declared by Hunter 0.24.0's CMake scripts (Hunter is only used for the test dependencies). This also blocks the Windows wheel build, which runs later in the same job.Fix: set
CMAKE_POLICY_VERSION_MINIMUM=3.5as an environment variable — unlike a-Doption it also reaches Hunter's child cmake invocations and the packages it builds. CMake < 4 ignores it, so the VS2017 jobs are unaffected. Verified by reproducing the identical Hunter failure with CMake 4.4 on Linux (-DETHASH_TESTING=ON) and confirming the variable lets configure complete, including the Hunter/GTest bootstrap. (The durable alternative is bumping HunterGate to a CMake-4-compatible Hunter release; this is the minimal-churn version.)circleci: build universal2 macOS wheels
CircleCI's macOS runners are Apple silicon now, so
macos-releaseproduces arm64-only wheels tagged for the runner's OS (macosx_14_0), and Intel Macs get no wheel at all. Cross-compile the wheel as universal2 (x86_64 + arm64) and setMACOSX_DEPLOYMENT_TARGET=11.0, so a single wheel covers every arm64 Mac and Intel Macs on Big Sur or newer. The architecture flags are exported for both compile steps:CMAKE_OSX_ARCHITECTURESfor the cmake build of the static libraries andARCHFLAGS/CFLAGS/LDFLAGSfor the cffi extension;_PYTHON_HOST_PLATFORMmakes the wheel platform tag match.Note: the x86_64 slice is cross-compiled and not executed in CI (the C++ tests and pytest run natively on arm64). If two thin wheels are preferred over one fat wheel, this converts to a second build pass with different flags.
Complements #244: with both merged, each release ships one abi3 wheel per platform covering CPython 3.10+ on Linux x86_64, Windows x64, and both macOS architectures.