WIP: ci: Compile arm64 natively on the ubuntu-arm64 runner #2155

Draft
morgan wants to merge 1 commit from morgan/arm64-runner into main
Owner

The arm64 build cross-compiled with the Rust target triple inside an amd64 container and copied the binary out, deliberately avoiding Docker emulation because arm64 emulation is unreliable on some BuildKit instances. A dedicated Ubuntu VM on an M4 Mac Mini is now available under the ubuntu-arm64 label, so each matrix entry carries its own runner label and a native flag, letting individual builds move between runners or build modes without changing the workflow structure.

Where native is set, the new build-native action compiles on the host and assembles the artefact tree, leaving Docker to package the result. The Dockerfile's ARTIFACTS argument selects whether the artefacts come from the builder stage or from out/ in the build context, and everything from prepper onwards is unchanged. Libraries are resolved where the binary was linked, so arm64 images now carry Ubuntu's rather than Debian's.

Also split the architecture flags, since the C and Rust sides need different syntax on ARM. The default aarch64 target only enables neon, so arm64 now passes +crc supported on every 64-bit Raspberry Pi since the Pi 2, and on Neoverse and Apple Silicon. amd64 still passes haswell to both sides, and TARGET_CPU continues to drive the tag suffix.

This only covers arm64 for now. The native path needs persistent storage on the runner, and the amd64 Docker runners don't have that configured. Having several amd64 runners would be fine, the cache would just be less fresh on each, but setting up persistence needs hardware I don't have yet. sccache could point at a shared S3 or MinIO backend if I stood one up, though cargo's target directory has no remote equivalent, so the persistence problem stands either way. I'm happy for this to wait if you'd rather both architectures moved together. Otherwise arm64 can use it now and amd64 follows when the hardware does.

The arm64 build cross-compiled with the Rust target triple inside an amd64 container and copied the binary out, deliberately avoiding Docker emulation because arm64 emulation is unreliable on some BuildKit instances. A dedicated Ubuntu VM on an M4 Mac Mini is now available under the `ubuntu-arm64` label, so each matrix entry carries its own runner label and a native flag, letting individual builds move between runners or build modes without changing the workflow structure. Where native is set, the new build-native action compiles on the host and assembles the artefact tree, leaving Docker to package the result. The Dockerfile's ARTIFACTS argument selects whether the artefacts come from the builder stage or from out/ in the build context, and everything from prepper onwards is unchanged. Libraries are resolved where the binary was linked, so arm64 images now carry Ubuntu's rather than Debian's. Also split the architecture flags, since the C and Rust sides need different syntax on ARM. The default aarch64 target only enables neon, so arm64 now passes `+crc` supported on every 64-bit Raspberry Pi since the Pi 2, and on Neoverse and Apple Silicon. amd64 still passes haswell to both sides, and TARGET_CPU continues to drive the tag suffix. This only covers arm64 for now. The native path needs persistent storage on the runner, and the amd64 Docker runners don't have that configured. Having several amd64 runners would be fine, the cache would just be less fresh on each, but setting up persistence needs hardware I don't have yet. sccache could point at a shared S3 or MinIO backend if I stood one up, though cargo's target directory has no remote equivalent, so the persistence problem stands either way. I'm happy for this to wait if you'd rather both architectures moved together. Otherwise arm64 can use it now and amd64 follows when the hardware does.
ci: Build arm64 images on the native ubuntu-arm64 runner
All checks were successful
Auto Labeler / Apply labels based on changed files (pull_request_target) Successful in 3s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m8s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m14s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
d062fb349e
The linux/arm64 legs of build-release and build-maxperf ran on the dind
runner under QEMU emulation. A dedicated Ubuntu VM on an M4 Mac Mini is
now available under the ubuntu-arm64 label, so the arm64 matrix entries
target it directly and build natively.

Each matrix entry carries its own runner label rather than the job pinning
runs-on, keeping the amd64 legs on dind.
ci: Compile arm64 natively on the host runner
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m7s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m13s
69afd4d907
The arm64 legs of build-release and build-maxperf ran on the dind
runner under QEMU emulation. A dedicated Ubuntu VM on an M4 Mac Mini
is now available under the ubuntu-arm64 label, so each matrix entry
carries its own runner label and the arm64 entries target it. The
amd64 legs stay on dind.

Where the runner architecture matches the target, the new build-native
action compiles on the host and assembles the artefact tree, leaving
Docker to package it. Libraries are resolved on the host because that
is where the binary was linked; resolving them in the container would
ship a different set.

The Dockerfile takes an ARTIFACTS argument selecting whether the
artefacts come from the builder stage or from out/ in the build
context. The prepper and final image stages are unchanged.
morgan force-pushed morgan/arm64-runner from 69afd4d907
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m7s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m13s
to affb609326
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m6s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m16s
2026-08-20 12:39:35 +00:00
Compare
morgan changed title from ci: Build arm64 images on the native ubuntu-arm64 runner to ci: Compile arm64 natively on the ubuntu-arm64 runner 2026-08-20 12:40:45 +00:00
morgan changed title from ci: Compile arm64 natively on the ubuntu-arm64 runner to WIP: ci: Compile arm64 natively on the ubuntu-arm64 runner 2026-08-20 12:41:03 +00:00
morgan force-pushed morgan/arm64-runner from affb609326
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m6s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m16s
to b4c89e2421
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m12s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m14s
Checks / Prek / Check changed files (pull_request) Successful in 9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
2026-08-20 13:34:09 +00:00
Compare
morgan force-pushed morgan/arm64-runner from b4c89e2421
All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m12s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m14s
Checks / Prek / Check changed files (pull_request) Successful in 9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
to 13afb88ded
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m2s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m18s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
2026-08-20 15:25:25 +00:00
Compare
morgan force-pushed morgan/arm64-runner from 13afb88ded
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m2s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m18s
Checks / Prek / Check changed files (pull_request) Successful in 7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
to 7e979882bd
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m5s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m23s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m26s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 10s
2026-08-20 15:58:36 +00:00
Compare
morgan self-assigned this 2026-08-20 16:53:55 +00:00
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m5s
Checks / Prek / Check changed files (pull_request) Successful in 6s
Required
Details
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m23s
Required
Details
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m26s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
Required
Details
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 10s
Required
Details
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin morgan/arm64-runner:morgan/arm64-runner
git switch morgan/arm64-runner
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!2155
No description provided.