Skip to content

ci: fix Windows builds under CMake 4, build universal2 macOS wheels#245

Open
danceratopz wants to merge 2 commits into
chfast:masterfrom
danceratopz:ci-fix-wheel-builds
Open

ci: fix Windows builds under CMake 4, build universal2 macOS wheels#245
danceratopz wants to merge 2 commits into
chfast:masterfrom
danceratopz:ci-fix-wheel-builds

Conversation

@danceratopz

Copy link
Copy Markdown
Collaborator

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.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. 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-release produces 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 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.

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.

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.
@danceratopz

Copy link
Copy Markdown
Collaborator Author

Looks like the relevant bits of CI passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant