Skip to content

ci: cross-compile x86_64-apple-darwin on the arm64 macOS runner#1260

Merged
geoffjay merged 1 commit into
mainfrom
ci-cross-compile-darwin-x64
Jun 11, 2026
Merged

ci: cross-compile x86_64-apple-darwin on the arm64 macOS runner#1260
geoffjay merged 1 commit into
mainfrom
ci-cross-compile-darwin-x64

Conversation

@geoffjay

Copy link
Copy Markdown
Owner

The macos-15-intel runner is the slowest job in the release matrix (1h+
builds). macOS cross-compiles between architectures with the same Xcode
SDK, so build the x86_64 darwin target on macos-latest (arm64) instead
and drop the Intel runner entirely.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

The macos-15-intel runner is the slowest job in the release matrix (1h+
builds). macOS cross-compiles between architectures with the same Xcode
SDK, so build the x86_64 darwin target on macos-latest (arm64) instead
and drop the Intel runner entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label Jun 11, 2026
@geoffjay

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.13%. Comparing base (c605c26) to head (2abcefa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1260      +/-   ##
==========================================
- Coverage   46.13%   46.13%   -0.01%     
==========================================
  Files         390      390              
  Lines       27293    27293              
  Branches     2501     2501              
==========================================
- Hits        12592    12591       -1     
- Misses      14679    14680       +1     
  Partials       22       22              
Flag Coverage Δ
frontend 68.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@geoffjay

Copy link
Copy Markdown
Owner Author

Code Review: ci: cross-compile x86_64-apple-darwin on the arm64 macOS runner

Note: GitHub prevents approving your own PR, so posting as a comment. No blocking issues — clean change.

Stack position

Targets main directly, but this branch builds on cache-warm.yml introduced by PR #1259 (which already has merge-queue). The ordering is correct; #1259 should land first and this will apply cleanly.

Technical correctness

The cross-compilation premise is sound and the implementation is correct:

  • Apple's Xcode toolchain is multi-arch by design: clang on any macOS host accepts -target x86_64-apple-macosx... and produces correct x86_64 output. cargo build --target x86_64-apple-darwin on arm64 is a well-established pattern — this is how universal (fat) macOS binaries are built in CI generally.
  • protoc is host-only: the arm64 protoc from brew is a code generator that runs on the build machine; its output arch doesn't need to match the compilation target. ✓
  • C build-script crates (anything using the cc crate): Apple clang transparently handles the -target flag, so cross-compiling C dependencies requires no extra setup — unlike Linux, where you'd need a separate cross-linker. ✓
  • dtolnay/rust-toolchain@stable with targets: x86_64-apple-darwin: installs the correct Rust sysroot for the target regardless of host architecture. ✓
  • Cache compatibility: rust-cache keys on shared-key: release-${{ matrix.target }} (target-specific, not runner-specific). A x86_64-apple-darwin artifact compiled on Intel is bit-for-bit identical to one compiled on arm64 with the same rustc/Cargo.lock, so the existing cached artifacts are directly reusable after this change. ✓

Consistency

Both release.yml and cache-warm.yml are updated in the same commit — the matrices remain in sync. ✓

No blocking issues

Approving. The change is minimal, technically correct, and well-commented in release.yml. Dropping macos-15-intel from the matrix is safe — cross-compiled x86_64-apple-darwin binaries from an arm64 runner are functionally identical to natively built ones.

@geoffjay geoffjay added merge-queue Approved by reviewer, queued for merge by conductor and removed review-agent Used to invoke a review by an agent tracking this label labels Jun 11, 2026
@geoffjay geoffjay merged commit 5fbf189 into main Jun 11, 2026
12 checks passed
@geoffjay geoffjay deleted the ci-cross-compile-darwin-x64 branch June 11, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Approved by reviewer, queued for merge by conductor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant