Skip to content

build: pin Rust through Hermit rustup and rust-toolchain.toml - #1871

Merged
wesbillman merged 3 commits into
mainfrom
chore/hermit-rustup
Oct 29, 2026
Merged

wesbillman merged 3 commits into
mainfrom
chore/hermit-rustup

Conversation

@matt2e

@matt2e matt2e commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Hermit's rust package is the official per-host release tarball. It includes only the host's standard library and can't add targets: on macos-latest, lib/rustlib contains only aarch64-apple-darwin. This PR follows block/buzz: Hermit pins rustup and the root rust-toolchain.toml pins Rust. Every machine and CI job then resolves the same toolchain through rustup, and extra targets are one rustup target add away. 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.toml pins 1.98.1 with the minimal profile plus clippy, rustfmt and rust-analyzer, the tools the old pin provided.
  • CARGO_HOME is still shared through bin/hermit.hcl. Toolchains install under ~/.rustup the first time they're used.
  • scripts/build-goose-acp.mjs sets RUSTUP_TOOLCHAIN from rust-toolchain.toml. The goose checkout carries its own toolchain file (1.99.0), which Hermit's plain rust used to ignore, so goose-acp keeps building with this repository's pin. The parser also accepts CRLF checkouts on Windows.
  • The Windows jobs in ci.yml and release.yml now read the version from rust-toolchain.toml instead of the Hermit pin filename.
  • docs/contributing.md is updated to match.

There are no release, target or Intel changes.

Validation

  • bin/rustc -V reports 1.98.1.
  • cargo fmt --all --check passes, and so does cargo clippy --workspace --locked --all-targets -- -D warnings.
  • node scripts/build-goose-acp.mjs --dev: the staged binary embeds rustc 48a229cea (1.98.1), not goose's 1.99.0.
  • The pre-push design-system, clippy and org checks pass.
  • The full JS unit suite is triggered by any 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.
  • CI and a candidates-only release run will cover the Linux and Windows builds.

Notes for review

  • CI time: the toolchain used to arrive through the Hermit package cache. Now rustup downloads it from static.rust-lang.org in each Rust job, about 12s cold on a local machine. If job times regress, a follow-up can cache ~/.rustup keyed on rust-toolchain.toml.
  • Deprecated auto-install: rustup 1.29 warns that toolchain auto-install is deprecated (rust-lang/rustup#4836). Hermit pins rustup, so the default can only change with a deliberate bump. An explicit rustup toolchain install step can be added then.

🤖 Generated with Claude Code

@matt2e
matt2e marked this pull request as ready for review October 29, 2026 05:31
@matt2e
matt2e requested a review from a team as a code owner October 29, 2026 05:31
@matt2e
matt2e force-pushed the chore/hermit-rustup branch from 24a426e to 490acd0 Compare October 29, 2026 05:43

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Found one concurrent bootstrap failure affecting local toolchain installation.

Comment thread rust-toolchain.toml
matt2e and others added 2 commits October 29, 2026 17:33
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>
@matt2e
matt2e force-pushed the chore/hermit-rustup branch from ff332e4 to c5d7bb4 Compare October 29, 2026 06:45

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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.

Comment thread bin/rustfmt
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 wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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 wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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.

Comment thread docs/contributing.md
just --list
```

Run `rustup toolchain install` after cloning and after `rust-toolchain.toml`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread docs/contributing.md
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`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@wesbillman
wesbillman merged commit 1ed8f5c into main Oct 29, 2026
36 checks passed
@wesbillman
wesbillman deleted the chore/hermit-rustup branch October 29, 2026 19:21
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.

3 participants