From 3815cc4b0c3e1a39351c83d242f2ad03c10f803b Mon Sep 17 00:00:00 2001 From: Vyncint Ng <115854244+vyncint@users.noreply.github.com> Date: Sun, 23 Aug 2026 14:31:25 +0700 Subject: [PATCH] ci(binaries): cross-build the Intel Mac from Apple silicon On the v0.6.2 release the x86_64-apple-darwin leg sat queued for forty-five minutes while every other target finished inside ninety seconds. GitHub is winding the Intel runners down, and a target nobody can schedule is a target that silently stops shipping. It does not need one. Xcode's toolchain and SDK are universal, so an arm64 runner produces an x86-64 binary with nothing but rustup target add -- no sysroot to fetch, no linker to configure. The job now asks file what it actually built and fails if the answer is not the architecture the target names. A cross-build that quietly produced the host's architecture would pass every other check here and fail on the first machine that downloaded it, which is the one failure mode this change introduces and therefore the one worth checking. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com> --- .github/workflows/binaries.yml | 28 +++++++++++++++++++++++++++- CHANGELOG.md | 15 +++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 2335a3f..ec8602c 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -66,8 +66,18 @@ jobs: os: ubuntu-latest - target: aarch64-unknown-linux-musl os: ubuntu-24.04-arm + # Cross-compiled from Apple silicon rather than built on macos-13. + # Xcode's toolchain and SDK are universal, so an arm64 Mac produces + # an x86-64 binary with nothing but `rustup target add` — there is + # no sysroot to fetch and no linker to configure. + # + # The Intel runners are being wound down and it shows: on the v0.6.2 + # release this leg sat queued for forty-five minutes while every + # other target finished inside ninety seconds. A target nobody can + # schedule is a target that silently stops shipping, which is worse + # than one that is cross-built. - target: x86_64-apple-darwin - os: macos-13 + os: macos-latest - target: aarch64-apple-darwin os: macos-latest - target: x86_64-pc-windows-msvc @@ -152,6 +162,22 @@ jobs: cp "$archive" "$alias" sums "$alias" > "${alias}.sha256" + # A cross-built binary that is quietly the host's architecture would + # pass every other check here and fail on the first machine that + # downloaded it. Ask the file what it is. + case "$TARGET" in + x86_64-apple-darwin) want="x86_64" ;; + aarch64-apple-darwin) want="arm64" ;; + *) want="" ;; + esac + if [ -n "$want" ]; then + got=$(file -b "target/${TARGET}/release/mossaic-art") + case "$got" in + *"$want"*) echo "architecture check: $want — $got" ;; + *) echo "::error::built for $TARGET but the binary is: $got"; exit 1 ;; + esac + fi + echo "ARCHIVE=$archive" >> "$GITHUB_ENV" echo "ALIAS=$alias" >> "$GITHUB_ENV" diff --git a/CHANGELOG.md b/CHANGELOG.md index e9eb462..40f69f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,21 @@ listed under a **Changed** or **Removed** heading. ### Fixed +- **The Intel-Mac binary is cross-compiled from Apple silicon** rather than + built on a `macos-13` runner. Xcode's toolchain and SDK are universal, so an + arm64 Mac produces an x86-64 binary with nothing but `rustup target add` — + no sysroot, no linker configuration. + + The Intel runners are being wound down and it shows: on the v0.6.2 release + this leg sat queued for forty-five minutes while every other target finished + inside ninety seconds. A target nobody can schedule is a target that + silently stops shipping. + + The job now asks `file` what it actually built, and fails if the answer is + not the architecture the target names — a cross-build that quietly produced + the host's architecture would pass every other check here and fail on the + first machine that downloaded it. + - **The README no longer promises Homebrew.** The line went in ahead of the tap existing, on the assumption that the tap would follow within the hour. It has not yet, and an install command that does not work is worse than one