Skip to content

Build the macOS x64 packages on arm64 instead of Intel - #302

Merged
3nids merged 18 commits into
mainfrom
cross-ci
Nov 7, 2026
Merged

3nids merged 18 commits into
mainfrom
cross-ci

Conversation

@3nids

@3nids 3nids commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #300, which is stacked on #299. This PR's base is #300's branch, cross-python3-target-dep.

The macOS workflow now builds x64-osx-dynamic on an arm64 runner with --host-triplet=arm64-osx-dynamic, instead of natively on macos-15-intel. The x64 target tools run under Rosetta. Both macOS jobs run on macos-26, so they use the same Xcode and the cross job reuses the arm64 host packages that the native arm64 job puts in the binary cache.

Required checks: the job names change, so the ruleset on main needs updating when this is merged:

  • build (macos) (macos-15, arm64-osx-dynamic) → build (macos) (macos-26, arm64-osx-dynamic)
  • build (macos) (macos-15-intel, x64-osx-dynamic) → build (macos) (macos-26, x64-osx-dynamic, arm64-osx-dynamic)

Workflow

Ports

In a native build the host and target are the same, so these change nothing there.

  • py-meson: passes the triplet's compiler flags to meson, and lets meson run x64 test programs on arm64 macOS.
  • vcpkg-python-scripts:
    • The import test runs with the target interpreter.
    • When the target interpreter builds a wheel, the target site-packages come before the host ones.
  • Target dependencies: ports whose build imports a tool with compiled modules (Cython, numpy, cffi, ...) in the target interpreter now also depend on it as a target dependency. The host's arm64 build can't be loaded by the x64 interpreter. A few ports also had missing host build dependencies or runtime requirements.
  • py-fonttools: always builds the Cython extensions. Before, it built them only if another port happened to install Cython first.
  • arrow: pyarrow is built with the vcpkg toolchain on macOS. Otherwise a cross build compiles it for the host architecture, with the host's SIMD flags.
  • py-contourpy: builds with meson-python and pybind11. The port had never built.
  • py-matplotlib: passes the Objective-C compiler to meson, and depends on contourpy and packaging.

Testing

  • The CI list passes in the cross job on macos-26 (runs on cross-ci before this cleanup).
  • Locally, the same list plus the Python packages from QGIS's manifest (about 330 packages) was cross-built on arm64 macOS 26. Every binary in the x64 tree is x86_64, and a runtime check passes under Rosetta: numpy through geopandas, rasterio, matplotlib, pyarrow, duckdb, ADBC and others.

Comment thread .github/workflows/macos.yml Outdated
branches:
- main
- create-pull-request/**
- cross-**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this pattern something we plan to continue to use and if yes in what situation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just for testing this here, I will drop that when we merge

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we replace the existing intel workflow with this one?

Comment thread .github/workflows/macos.yml Outdated
strategy:
matrix:
include:
- os: macos-15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we run this already on macos-26?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Comment thread .github/workflows/macos.yml Outdated
Comment on lines +17 to +18
# A push to a cross-* branch only runs build-cross; its pull request still runs this job.
if: github.event_name != 'push' || !startsWith(github.ref_name, 'cross-')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo

@3nids 3nids changed the title Cross-build x64-osx on an arm64 runner for cross-* branches Build the macOS x64 packages on arm64 instead of Intel Nov 7, 2026
@3nids
3nids force-pushed the cross-ci branch 2 times, most recently from fbe6f43 to d08f9e8 Compare November 7, 2026 21:29
Base automatically changed from cross-python3-target-dep to main November 7, 2026 21:29
@3nids
3nids merged commit 80ca01d into main Nov 7, 2026
1 check passed
@3nids
3nids deleted the cross-ci branch November 7, 2026 21:29
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.

2 participants