ci: pin the prek job's Rust toolchain to rust-toolchain.toml#454
Merged
andrius-puksta-sensmetry merged 1 commit intoJul 20, 2026
Merged
Conversation
consideRatio
force-pushed
the
ci/pin-rust-for-prek
branch
from
July 19, 2026 08:21
ed11888 to
58b7acd
Compare
This was referenced Jul 19, 2026
andrius-puksta-sensmetry
approved these changes
Jul 20, 2026
Collaborator
|
(commit has to be signed) |
andrius-puksta-sensmetry
enabled auto-merge (squash)
July 20, 2026 05:21
1 task
prek's language: rust hooks do not use the toolchain pinned by rust-toolchain.toml: prek picks a toolchain itself from what is installed, preferring the runner's latest stable. A newer stable clippy then rewrites files via the --fix hook and fails the gate with 'files were modified' (seen when the runner image moved to 1.97). Pin in two parts, verified against prek's trace output: - language_version on the rust hooks in .pre-commit-config.yaml, prek's own selector and the part that actually pins. - A rustup toolchain install step in the workflow so the pinned toolchain (with the rustfmt/clippy components) exists for prek to find. prek's own mid-hook download is profile-minimal without those components, and cargo then silently falls through to another toolchain's binaries. rust-toolchain.toml and the hook config cross-reference each other so the two pins get bumped together. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EfyrkJkeo3mRngVoppJjUN Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
consideRatio
force-pushed
the
ci/pin-rust-for-prek
branch
from
July 20, 2026 06:56
58b7acd to
3dbc6ce
Compare
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.
The prek job's
language: rusthooks do not use the toolchain pinned byrust-toolchain.toml: prek picks a toolchain itself from what is installed, preferring the runner image's latest stable. When a newer stable clippy adds an auto-fixable lint, thecargo clippy --fixhook rewrites files and fails the gate with "files were modified". This hit #453 after the runner image moved to 1.97, forcing it to carry four unrelated lint fixes.Two changes, verified locally by reproducing the failure and confirming the fix against prek's trace output:
language_version: "1.96"on the rust hooks in.pre-commit-config.yaml: prek's own selector, the part that actually pins.rustup toolchain installstep in the workflow so the pinned toolchain (with the rustfmt/clippy components) exists for prek to find. Without it, prek downloads a profile-minimal toolchain lacking those components and cargo silently falls through to another toolchain's binaries.The pin now lives in two places;
rust-toolchain.tomland the hook config cross-reference each other so they get bumped together.🤖 Generated with Claude Code
https://claude.ai/code/session_01EfyrkJkeo3mRngVoppJjUN