Skip to content

build: pin the toolchain so a fresh clone can't fail on a stale default - #30

Merged
tobi merged 1 commit into
tobi:mainfrom
adi0x90:repo-build/pin-toolchain
Sep 27, 2026
Merged

tobi merged 1 commit into
tobi:mainfrom
adi0x90:repo-build/pin-toolchain

Conversation

@adi0x90

@adi0x90 adi0x90 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Fixes the fresh-clone failure reported in #29.

make install on a clone whose rustup default was older than 1.97 died with
error: rustc 1.94.0 is not supported by the following package: xtask@0.10.1 requires rustc 1.97, naming xtask because cargo xtask builds it first.
Cargo enforces the workspace MSRV before compiling anything, and nothing
provisioned that toolchain: CI pins 1.97, the README requires it, but there was
no rust-toolchain.toml, so a stale default was a hard failure.

Change

  • rust-toolchain.toml — channel = "1.97", components = ["clippy", "rustfmt"]. rustup fetches it on the first build, and the two components are
    what make lint needs. The channel is the version CI already pins, so local
    clippy and rustfmt now match the gate exactly instead of drifting with the
    machine's default.
  • README.md — one sentence saying the pin exists, next to the existing
    "1.97 or newer" requirement.

This helps rustup users only. A distro-packaged cargo ignores
rust-toolchain.toml; for those builders the fix is the rust-version floor
discussed in #29, which this PR deliberately leaves alone rather than
declare 1.95 from macOS-only evidence.

Verification

From this commit (macOS/aarch64, rustc 1.97.1):

  • cargo xtask --help — the command that failed — runs.
  • cargo xtask lint green: fmt --check plus clippy --workspace --all-targets -D warnings, including disktree-app and xtask.
  • cargo xtask bundle builds and signs, producing
    target/bundle/disktree-0.10.1-aarch64-macos.zip.

`cargo xtask bundle` from a fresh clone failed with `rustc 1.94.0 is not
supported by the following package: xtask@0.10.1 requires rustc 1.97` when
the machine's `rustup default` was older than the workspace MSRV. The message
blames xtask only because `.cargo/config.toml` aliases `cargo xtask` to
`cargo run -p xtask`, so it is the first package in the build graph; cargo
rejects the whole workspace before anything compiles.

CI pins 1.97 but nothing provisioned it for builders. rust-toolchain.toml
pins the same version, with the clippy and rustfmt that `make lint` needs, so
rustup fetches it on the first build and local lints match the gate.

Verified from this commit: `cargo xtask --help` (the command that failed)
runs, `cargo xtask lint` is green, and `cargo xtask bundle` produces
target/bundle/disktree-0.10.1-aarch64-macos.zip.
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.

2 participants