Repository navigation
build: pin Rust through Hermit rustup and rust-toolchain.toml - #1871
Conversation
24a426e to
490acd0
Compare
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Found one concurrent bootstrap failure affecting local toolchain installation.
Hermit's `rust` package is the per-host release tarball: it carries only the host's standard library and cannot add targets. Pin Hermit's `rustup` instead and move the Rust version into `rust-toolchain.toml`, matching block/buzz, so every machine and CI job resolves the same toolchain through rustup and extra targets can be added with `rustup target add`. The Windows jobs read the version from rust-toolchain.toml instead of the Hermit pin. Co-authored-by: Jitter <2b2e6415e748c35180847a37aadae06a11e30dddc76b784e7fd9354c4eb42e7a@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
rustup does not serialize installs into the shared ~/.rustup, so concurrent first use of the proxies (an editor plus a terminal, or parallel worktrees) can leave a component's binaries missing while rustup reports it installed. Run `rustup toolchain install` from the worktree bootstrap before pnpm and any Rust consumer start, document running it after cloning and after a rust-toolchain.toml change, and document reinstalling the toolchain to repair a damaged install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
ff332e4 to
c5d7bb4
Compare
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord’s automated source review via Wes’s account.
One P2 finding inline: preserve the Rust pin in the disposable hook fixture. No other production defects found. Optional: refresh the description’s Goose compilation/parser claims; this revision stages a prebuilt binary.
Head c5d7bb435e217880a0ac1c222e45a4aff5095e11; base 11dd17bb7775a2932ca2466235354105edf2041b. Rocket, Mantis and Groot reviewed independently. Source-only; no local execution. Hosted CI passed with Windows skipped; clean-machine setup and release workflows remain unverified.
The Rust proxies now resolve through rustup, which picks the toolchain from the working directory. The hook-test fixture runs outside the repo, so without the toolchain file rustup falls back to the default toolchain: it fails where none is configured (a Hermit-only machine) and otherwise formats with an unpinned rustfmt. Copy rust-toolchain.toml with the other configuration files so the fixture's rustfmt job uses the pin, as the production hook does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord’s automated source review via Wes’s account.
No further changes requested: the two-line follow-up copies and commits rust-toolchain.toml into the hook fixture, addressing the previous P2; no new defects found in the repair. Rocket, Mantis and Groot independently checked the follow-up.
Head 87c4ad1c93d0bcffaba50618df0f6a542e61e91e; base 11dd17bb7775a2932ca2466235354105edf2041b. Source-only: no tests or clean-machine execution; CI was still running at the snapshot, with Windows skipped, and test-cost changes were not measured.
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Carl, an automated reviewer, commenting via Wes's GitHub account.
No blockers at 87c4ad1c (base 11dd17bb). Two optional comments inline.
Validation: a cold RUSTUP_HOME probe with Hermit rustup 1.29.2 auto-installed 1.98.1 and all requested components. Upgrading an existing 1.98.1 install fills in the missing components. The Linux/Windows candidates run at 24a426e (identical release workflow, toolchain file and Hermit config) passed, which exercises the PowerShell parser. No other Rust consumer runs outside the repo cwd beyond the hooks fixture. Not exercised: a signed macOS release, and Windows native CI, which was skipped on this head.
PR text: the build-goose-acp.mjs / RUSTUP_TOOLCHAIN bullet and its validation step are out of date. Since #1864, that script downloads pinned goose-acp releases and no commit here touches it. Please drop them from the description.
| just --list | ||
| ``` | ||
|
|
||
| Run `rustup toolchain install` after cloning and after `rust-toolchain.toml` |
There was a problem hiding this comment.
Optional: the bootstrap install only covers new worktrees. Existing checkouts that pull this get an implicit install on the first proxy call, so an editor plus a terminal can still hit the concurrent-install failure described here. Reproduced: bin/rustup --version silently added rust-analyzer to an existing 1.98.1. An "after pulling this, run bin/rustup toolchain install once" note at merge is probably enough. A hook would be overkill.
| missing a component's binaries while rustup reports it installed (for example, | ||
| `cargo clippy` fails although `rustup component add clippy` says it is up to | ||
| date). To repair it, reinstall the toolchain: | ||
| `rustup toolchain uninstall 1.98.1 && rustup toolchain install`. |
There was a problem hiding this comment.
Nit: the hardcoded 1.98.1 goes stale on the next bump. rustup toolchain uninstall "$(rustup show active-toolchain | cut -d' ' -f1)" or a "the pinned version" phrasing would avoid that.
Summary
Hermit's
rustpackage is the official per-host release tarball. It includes only the host's standard library and can't add targets: onmacos-latest,lib/rustlibcontains onlyaarch64-apple-darwin. This PR follows block/buzz: Hermit pinsrustupand the rootrust-toolchain.tomlpins Rust. Every machine and CI job then resolves the same toolchain through rustup, and extra targets are onerustup target addaway. The Intel macOS build in block/buzz-app#1825 will stack on this PR.bin/.rust-1.98.1.pkg→bin/.rustup-1.29.2.pkg.rust-toolchain.tomlpins1.98.1with theminimalprofile plus clippy, rustfmt and rust-analyzer, the tools the old pin provided.CARGO_HOMEis still shared throughbin/hermit.hcl. Toolchains install under~/.rustupthe first time they're used.scripts/build-goose-acp.mjssetsRUSTUP_TOOLCHAINfromrust-toolchain.toml. The goose checkout carries its own toolchain file (1.99.0), which Hermit's plainrustused to ignore, so goose-acp keeps building with this repository's pin. The parser also accepts CRLF checkouts on Windows.ci.ymlandrelease.ymlnow read the version fromrust-toolchain.tomlinstead of the Hermit pin filename.docs/contributing.mdis updated to match.There are no release, target or Intel changes.
Validation
bin/rustc -Vreports1.98.1.cargo fmt --all --checkpasses, and so doescargo clippy --workspace --locked --all-targets -- -D warnings.node scripts/build-goose-acp.mjs --dev: the staged binary embeds rustc48a229cea(1.98.1), not goose's 1.99.0.bin/change. Two runs on a heavily loaded machine (load average ~28) failed different unrelated tests each time (7, then 2), mostly timeouts. All of those files pass in isolation (50/50 and 73/73). I pushed with only that hook excluded and am relying on CI for the full suite.Notes for review
~/.rustupkeyed onrust-toolchain.toml.rustup toolchain installstep can be added then.🤖 Generated with Claude Code