build: pin the toolchain so a fresh clone can't fail on a stale default - #30
Merged
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the fresh-clone failure reported in #29.
make installon a clone whoserustup defaultwas older than 1.97 died witherror: rustc 1.94.0 is not supported by the following package: xtask@0.10.1 requires rustc 1.97, namingxtaskbecausecargo xtaskbuilds 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 arewhat
make lintneeds. The channel is the version CI already pins, so localclippyandrustfmtnow match the gate exactly instead of drifting with themachine'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 therust-versionfloordiscussed 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 lintgreen:fmt --checkplusclippy --workspace --all-targets -D warnings, includingdisktree-appandxtask.cargo xtask bundlebuilds and signs, producingtarget/bundle/disktree-0.10.1-aarch64-macos.zip.