Skip to content

build: publish an upstream-based Rust builder to GHCR - #4377

Merged
dr-bonez merged 3 commits into
masterfrom
build/ghcr-rust-builder
Oct 23, 2026
Merged

dr-bonez merged 3 commits into
masterfrom
build/ghcr-rust-builder

Conversation

@helix-white

@helix-white helix-white commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Build and publish Start9's Rust builder directly from digest-pinned ghcr.io/rust-cross/cargo-zigbuild:0.24.0. There is no dependency on start9/cargo-zigbuild or the personal fork. Rebuild upstream cargo-zigbuild with the one-line RVA23 default patch; upstream supplies the macOS dylib fix for #4372.

Explicit additions are Rust 1.97.1 and its targets, checksum-pinned bindgen 0.72.1, CMake/lld/rsync, and three digest-pinned Alpine FUSE sysroots. Preserve existing target-specific Rust flags and explicit CPU overrides. Omit the legacy GNU cross-compiler tree and CMake overrides: no monorepo caller references them, and the build uses Zig's generated toolchains. Both rebuilt tools retain their licenses in the final image.

Native amd64 verification passed: 60 upstream library tests, bindgen output, FUSE pkg-config discovery for all three sysroots, native static FUSE linking, macOS dylib deduplication for both architectures and both argument paths, RVA23 defaults, an explicit scalar CPU override, CMake compilation through upstream-generated toolchains, and a native Linux-musl executable. ShellCheck, actionlint, scoped Prettier, Bash syntax, the retarget guard and diff checks passed. Native arm64 is assigned to CI. The revised workflow enables the shared QEMU setup for foreign-architecture sysroot stages.

CI publishes a combined sha-<full-commit>/latest GHCR manifest only after both native architectures pass, and only from master. This remains the producer step; consumers switch in a follow-up once the image publishes. The GHCR package needs public visibility after its first publication for unauthenticated pulls.

Supersedes dr-bonez/cargo-zigbuild#1. Cross-review is re-requested for this upstream-base revision; the earlier approval covered the previous base.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white

Copy link
Copy Markdown
Member Author

Fixed the first CI failure: the workflow-retarget guard requires every pull-request workflow in its explicit audited routing set. Added the reusable builder workflow, routed base changes to it with scoped package permissions, and updated the guard and documentation. The retarget guard, actionlint and scoped Prettier checks now pass locally; image code and its successful regression evidence are unchanged.

@helix-white

Copy link
Copy Markdown
Member Author

Cross-review requested.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head ada138e. git merge-tree --write-tree origin/master HEAD is clean.

Checked:

  • Publish gating: PUBLISH and the publish job need refs/heads/master and a non-pull_request event. pr-retarget.yml triggers on pull_request: [edited], so the called workflow sees event_name == pull_request and never pushes on a retarget. Fork PRs get a read-only token anyway.
  • The retarget guard accepts the new target. Its permission set and job-level packages: write match the workflow, and the concurrency group has the literal rust-builder- prefix. check-pr-retarget-workflows.py passes locally.
  • Dockerfile: the base is pinned by digest and the upstream source by checksum. patch --fuzz=0 fails the build if the RVA23 hunk drifts. The final stage copies only the binary, the license and the verifier over the inherited cargo-zigbuild. verify.sh checks that the binary on PATH is 0.24.0.
  • verify.sh tests the behaviour that changed: duplicate-dylib dedup in both the direct and response-file paths on both macOS arches, RVA23 extensions under the default riscv64gc wrapper, no vector extensions when the CPU is overridden explicitly, and a native musl run.
  • make -n rust-builder rust-builder-check expands as expected. The AGENTS.md updates match the retarget set and the permission rules.

The native image build and verification on amd64/arm64 are left to CI (pending on this head). actionlint and shellcheck are not installed on this host, so I relied on the author's runs.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white
helix-white requested a review from dr-bonez October 23, 2026 20:00
@helix-white

Copy link
Copy Markdown
Member Author

Cross-review approved ada138e without requested changes. Updated the final brief and requested @dr-bonez. GitHub reports MERGEABLE and the latest-base merge check is clean. Image and other build/test CI jobs are still pending; existing formatting, version, license and conflict checks have passed. The consumer migration follows only after the producer merges, publishes, and is publicly pullable.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white force-pushed the build/ghcr-rust-builder branch from ada138e to d24b748 Compare October 23, 2026 20:54
@helix-white helix-white changed the title build: publish a patched upstream Rust builder to GHCR build: publish an upstream-based Rust builder to GHCR Oct 23, 2026
@helix-white
helix-white removed the request for review from dr-bonez October 23, 2026 20:54
@helix-white

Copy link
Copy Markdown
Member Author

Corrected the base selection in d24b748: the final image now derives directly from pinned upstream GHCR, not the legacy Start9 image. Added only the used tooling/sysroot additions explicitly. Omitted the unreferenced legacy GNU/CMake-override tree, with new generated-CMake and static-FUSE checks covering its actual replacement paths. All amd64 image checks and scoped lint checks pass. Rebased onto current master; native arm64 and current-head CI are pending. Withdrawing final-review handoff until fresh cross-review covers this change.

@helix-white

Copy link
Copy Markdown
Member Author

Please re-review d24b748: switched the base to pinned upstream GHCR, recreated the used toolchain/sysroot additions, removed unused legacy GNU assets, and expanded image verification. The previous approval covered the old base.

@dr-bonez
dr-bonez merged commit 5dff27e into master Oct 23, 2026
38 checks passed
@dr-bonez
dr-bonez deleted the build/ghcr-rust-builder branch October 23, 2026 20:56

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed head d24b748, starting from the change since ada138e, which is now rebased as 5828c8f/7e0a6889f plus d24b748. git merge-tree --write-tree origin/master HEAD is clean.

I compared the image configs and build history of the legacy start9/cargo-zigbuild@sha256:d335… and the new upstream base ghcr.io/rust-cross/cargo-zigbuild@sha256:eb55…:

  • Env carries over: PATH, RUSTUP_HOME, CARGO_HOME and SDKROOT are identical. RUST_VERSION goes back to 1.97.1, and CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_MUSL_RUSTFLAGS is byte-identical.
  • The new image reproduces the legacy image's own layers: the same 12 rustup target add targets, cmake/lld/rsync, bindgen 0.72.1 (now checksum-pinned), and /opt/sysroot/{x86_64,aarch64,riscv64}. Upstream supplies clang. verify.sh running bindgen shows that libclang loads.
  • Dropped: /opt/musl-cross-make and /root/cmake-overrides. Nothing in the repo references either path. The rust-zig-builder alias only sets PKG_CONFIG_{SYSROOT_DIR,LIBDIR} to /opt/sysroot/$ARCH, and the new pkg-config and static-FUSE checks exercise exactly that. The cmake consumer (aws-lc-sys) goes through cargo-zigbuild's generated toolchain, which the new CMake probe covers.
  • Also dropped: the toolchain is now --profile minimal + rustfmt + rust-src, so clippy and rust-docs are gone. No build/test script runs clippy in the builder container, so this is fine. It is a behaviour difference, though, if anyone uses the image interactively.
  • setup-build now runs its default QEMU + Buildx setup, which the foreign-arch Alpine sysroot stages need. The retarget guard still passes locally.

A note for the follow-up rather than this PR: CI here verifies only the image itself, so the real equivalence evidence is the consumer migration, where every product's build and tests run in the new image.

The native amd64/arm64 image jobs on this head are pending in CI.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo Repository maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants