ref:main

Build and publish macOS release binaries #35

merged colechristensen cole.christensen@gmail.com wants to merge fix/macos-release-builds into main

Summary

anvil update returned HTTP 404 on macOS because releases only ever published Linux binaries. The server (runner_download_controller.ex) and CLI (update.rs) already map Darwin/{aarch64,x86_64} → macos_{arm64,amd64}; the gap was the build script never producing them.

What it took (three obstacles, each verified by reproducing in Docker)

  1. Publish the targets — add aarch64/x86_64-apple-darwin to the zigbuild matrix, stage + version, include in SHA256SUMS, upload in release create. glibc-floor gate stays linux-only.
  2. macOS SDK — zig bundles glibc/musl but not Apple’s non-redistributable libSystem/frameworks. std + iana-time-zone (via chrono) link CoreFoundation, so an SDK is required. Fetch pinned joseluisq/macosx-sdks 12.3, point cargo-zigbuild at it via SDKROOT; MACOSX_DEPLOYMENT_TARGET=11.0.
  3. zig 0.14.0 iconv regression — even with the SDK, link failed: unable to find dynamic system library 'iconv'/'charset'. Root cause is zig 0.14.0’s macho linker: under rust ≥ 1.82 apple std links -liconv/-lcharset (rust#128370) and zig 0.14.0 can’t resolve them from the SDK — the SDKROOT path gets doubled (cargo-zigbuild#316). Bumping cargo-zigbuild alone did not help; the variable is the zig version. zig 0.15.2 resolves it (cargo-zigbuild 0.22.3 → 0.23.0 in lockstep).

Verification

Ran the real build-runner.sh end-to-end in Docker (rust:1.95-trixie, the CI runner image): all four targets link — linux arm64/amd64 + macos arm64/amd64 — and the glibc-floor gate still passes (both linux binaries max GLIBC_2.30 ≤ 2.31). Rebased on main so this branch also carries the #27 log-visibility fix.

Closes #26

Created Jul 13, 2026 at 00:25 UTC | Merged Jul 13, 2026 at 04:05 UTC by colechristensen cole.christensen@gmail.com