Skip to content

ci: pin the Rust toolchain in rust-toolchain.toml, with Dependabot to propose each new release - #204

Merged
aRustyDev merged 2 commits into
mainfrom
ci/pin-rust-toolchain
Nov 16, 2026
Merged

aRustyDev merged 2 commits into
mainfrom
ci/pin-rust-toolchain

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

The second of the review's smaller CI fixes (.agents/plans/cicd-review/PLAN.md): pin the Rust toolchain.

Why

Every build installed stable. A new Rust release could turn lint red, or change what a test saw, on whatever change happened to merge next, with nothing in the diff to explain it. CI installs 1.100.0 today (released 2026-11-09), so that is the pin.

What

  • rust-toolchain.toml sets channel = "1.100.0".
  • .github/scripts/toolchain-channel.sh reads the pin. It refuses anything but exactly one quoted MAJOR.MINOR.PATCH in [toolchain], so stable, nightly, 1.100, a second key, or a key in another table are all refused.
  • setup-rust installs that version through the same dtolnay/rust-toolchain step as before. Keeping the step keeps the environment it sets.
  • scripts/rs follows the pin instead of rustup's stable. If the pinned toolchain is missing, it prints the rustup toolchain install command.
  • .github/dependabot.yml uses the rust-toolchain ecosystem on a weekly schedule. Dependabot has supported this since August 2025. Each new stable arrives as a pull request, and a change to rust-toolchain.toml runs all of CI. Cargo dependencies and actions are deliberately not in it; adding them is a separate decision.
  • The two cargo metadata calls that build nothing (the changes job and test_plan_ci.py) use the runner's own stable through RUSTUP_TOOLCHAIN=stable. Without it, rustup would first install the pin there, and a failed install would quietly turn every plan into a full run.
  • plan-ci.py treats toolchain-channel.sh like the toolchain file: changing it runs everything.
  • Docs: cicd.md and running.md. The nightly run no longer claims to catch a new stable toolchain; Dependabot does that now.

Tests

  • test-toolchain-channel.sh (315 checks) covers every combination of:

    • the value: exact, partial, named channels, pre-release, prefixed, empty;
    • the quoting;
    • where the key sits: [toolchain], another table, a comment, or twice;
    • with or without a trailing comment.

    It also covers a missing file and the repository's own file.

  • 8 hand mutants of the reader, all caught.

  • scripts/rs in a copy of the tree:

    • a pin that isn't installed stops with the install command;
    • stable is refused;
    • 1.100.0 runs.
  • Every ci-scripts test and deps guard under dash: 38/38, with scripts/rs on 1.100.0.

Overlap with #202

#202 (--locked) edits the same "still open" sentence in cicd.md. Whichever merges second will need main merged into it, which I'll do.

Refs: #49

🤖 Generated with Claude Code

… propose each new release

Every build installed `stable`. A new Rust release could therefore turn
`lint` red, or change what a test saw, on whatever change merged next,
with nothing in the diff to show why. CI installs 1.100.0 today
(2026-11-09), and the pin is that version.

- rust-toolchain.toml: channel = "1.100.0".
- .github/scripts/toolchain-channel.sh reads the pin. It refuses
  anything but one quoted MAJOR.MINOR.PATCH in [toolchain]: stable,
  nightly, 1.100, a second key, or a key in another table.
- setup-rust installs that version through the same
  dtolnay/rust-toolchain step. Keeping the step keeps the environment it
  sets.
- scripts/rs puts the pinned toolchain first on PATH, instead of
  rustup's stable, and says how to install it when it is missing.
- .github/dependabot.yml: the rust-toolchain ecosystem, weekly, so
  each new stable comes as a pull request. A change to
  rust-toolchain.toml runs everything.
- The two `cargo metadata` calls that build nothing (the `changes` job,
  test_plan_ci.py in ci-scripts) use the runner's own stable
  (RUSTUP_TOOLCHAIN=stable). Otherwise rustup would install the pin
  first, and a failed install would quietly turn every plan into a full
  run.
- plan-ci.py: toolchain-channel.sh runs everything, like the
  toolchain file.
- Docs: cicd.md (setup-rust, the pinned versions, the nightly run's
  purpose) and running.md (scripts/rs).

Tests:
- test-toolchain-channel.sh: 315 checks. They cover every value
  (exact, partial, named channels, pre-release, prefixed, empty), every
  quoting, and every place the key can sit (in [toolchain], another
  table, a comment, twice), with and without a trailing comment. Also a
  missing file, and the repository's own file.
- 8 hand mutants of toolchain-channel.sh, each caught.
- scripts/rs, in a copy of the tree: a pin that is not installed stops
  with the install command (exit 1); `stable` is refused; 1.100.0 runs.
- Every ci-scripts test and deps guard under dash: 38/38.

Refs: #49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aRustyDev
aRustyDev merged commit 84939de into main Nov 16, 2026
66 of 68 checks passed
@aRustyDev
aRustyDev deleted the ci/pin-rust-toolchain branch November 16, 2026 05:03
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.

1 participant