Skip to content

ci: migrate cross builds to cargo-zigbuild#136

Merged
lance0 merged 3 commits into
masterfrom
ci/zigbuild
Jul 6, 2026
Merged

ci: migrate cross builds to cargo-zigbuild#136
lance0 merged 3 commits into
masterfrom
ci/zigbuild

Conversation

@lance0

@lance0 lance0 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Fixes the aarch64 cross-build glibc failures that landed on master (bf773ae).

Root cause

cross 0.2.5's aarch64-unknown-linux-{gnu,musl}:0.2.5 images ship an x86_64 glibc too old to run build scripts compiled by modern Rust (1.96 → GLIBC_2.28+ symbols). Fresh builds fail; CI caching masked it intermittently (green on #135, red on the master push). release.yml used the same cross 0.2.5, so the next fresh release build was at the same risk — the cross-smoke job caught a latent release regression, which is exactly its job.

Change (per spec)

  • Linux gnu/musl → cargo-zigbuild. Zig bundles musl and pins a glibc floor (aarch64-unknown-linux-gnu.2.17), no stale images.
  • Android → cross from git main (current-glibc images); zigbuild doesn't do NDK targets.
  • macOS → native cargo.
  • Removed cross 0.2.5 and the musl-tools install.
  • ci.yml cross-smoke now builds all 5 release targets (debug) on every PR; release.yml uses the same split for release + packaging (artifact names unchanged; packaging tolerates zigbuild's glibc-suffixed output dir).

Verify

This PR's Build (…) matrix must go green for all 5 targets — especially aarch64-unknown-linux-gnu and aarch64-unknown-linux-musl, the arms that were failing.

lance0 added 3 commits July 6, 2026 16:53
cross 0.2.5's aarch64 images ship an x86_64 glibc too old to run build
scripts produced by modern Rust (1.96), so `cross build` for
aarch64-unknown-linux-{gnu,musl} fails with GLIBC_2.28+ symbol errors on a
fresh build (masked intermittently by CI caching). release.yml built the
same targets with the same cross 0.2.5 and was on borrowed time.

Migrate the Linux gnu/musl targets to cargo-zigbuild in both ci.yml and
release.yml — Zig bundles musl and lets us pin a low glibc floor (.2.17 on
aarch64-gnu). Android stays on cross but from git main (current-glibc
images), since zigbuild does not handle the NDK target; macOS builds
natively. Removes cross 0.2.5 and the musl-tools install.

ci.yml cross-smoke now covers all 5 release targets in debug on every PR.
Release artifact names are unchanged (packaged by base target, tolerant of
zigbuild's glibc-suffixed output dir).
Add scripts/verify-target-binary.sh, used by both workflows:
- resolves the binary tolerant of cargo-zigbuild's glibc-suffixed target dir,
  failing loudly (with a find dump) if neither path holds an executable
- gnu targets: asserts no required GLIBC symbol above the 2.17 floor
- musl targets: asserts static (no GLIBC symbols, no dynamic interpreter)

release.yml packaging now calls it (find + verify + package by base target,
artifact names unchanged). ci.yml cross-smoke runs it as an ABI check on the
zigbuild targets, so a build that links the wrong ABI fails the PR, not just a
future release.
Addresses the adversarial-review finding that the release toolchain was
non-reproducible: setup-zig defaulted to Zig master (an ephemeral nightly),
cargo-zigbuild came from crates.io latest, and cross was built from the
moving main branch — any of which could drift and change or break a future
tag build without a repo change, in exactly the ABI/packaging area the
migration is meant to stabilize.

Pin all three (mirrored in ci.yml and release.yml so PR validation matches
tag builds), to the exact known-good versions the green run used:
- Zig 0.16.0 (latest stable; cargo-zigbuild 0.23.0 supports zig 0.15+)
- cargo-zigbuild 0.23.0 (--version)
- cross main @ 64b5bb4d (--rev)

Bump these intentionally via dependency-update review.
@lance0
lance0 merged commit 2060701 into master Jul 6, 2026
16 checks passed
@lance0
lance0 deleted the ci/zigbuild branch July 6, 2026 21:13
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.

1 participant