Skip to content

build: pin Rust toolchain to 1.95.0 and bump MSRV to match - #489

Merged
thiras merged 3 commits into
mainfrom
pin-rust-toolchain
May 8, 2026
Merged

thiras merged 3 commits into
mainfrom
pin-rust-toolchain

Conversation

@thiras

@thiras thiras commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #487.

Toolchain pin (commit fdaa8d7):

  • rust-toolchain.toml: channel = "stable" → channel = "1.95.0".
  • dtolnay/rust-toolchain@stable → @1.95.0 in 4 ci.yml jobs (fmt / clippy / doc / test) + 2 release.yml jobs (release / build-binaries). The msrv job initially stayed on @1.85.0.
  • CONTRIBUTING.md: new "Rust Toolchain" subsection.

MSRV bump (commit 0f023e3):

  • Cargo.toml: workspace rust-version 1.85 → 1.95 so MSRV matches the stable lint pin.
  • ci.yml msrv job: @1.85.0 → @1.95.0. The job stays — when MSRV later drops below stable again, the symbolic separation is already wired.
  • dependabot.yml: drop the versions: ["1.85.0"] ignore — both refs are at @1.95.0 and should bump in lockstep.
  • CLAUDE.md / CONTRIBUTING.md: MSRV references updated.
  • Bumping MSRV unlocked three new clippy categories whose suggestions need post-1.85 features:
    • clippy::collapsible_if (let-chains, stable since 1.88) — three sites in cache::origin::s3, cache::retry, cli::commands::node::is_connection_refused.
    • clippy::duration_suboptimal_units — three Duration::from_secs(60) → Duration::from_mins(1) (gossip reconnect, dispatch GC, runtime test).
    • clippy::missing_const_for_fn — SecretString::is_empty → const fn.

Why

PR #485 had a CI failure pre-commit was supposed to catch: clippy 1.95's clippy::duration_suboptimal_units fired in CI on code that was clean under the developer's local clippy 1.93. Pinning eliminates the local-vs-CI drift. Bumping MSRV in lockstep keeps the workspace's lower bound aligned with the lint set we actually exercise on day-to-day work.

Test plan

  • cargo --version reports 1.95.0 (rustup auto-selected via rust-toolchain.toml)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo nextest run --workspace — 672/672 pass
  • pre-commit run --all-files clean
  • CI all green (fmt / clippy / doc / test / msrv) on this PR
  • Within ~1 week of merge, dependabot opens a PR bumping every dtolnay/[email protected] ref together when a newer stable lands. With no version-specific ignore active, all five refs should advance in lockstep.

🤖 Generated with Claude Code

Pin `rust-toolchain.toml` and the four `dtolnay/rust-toolchain@stable` refs
in `ci.yml` (fmt, clippy, doc, test) plus the two in `release.yml` (release,
build-binaries) to the same exact version. The MSRV pin (`@1.85.0`) stays
untouched — distinct knob, distinct job.

Update dependabot to ignore only the MSRV version (`versions: ["1.85.0"]`)
so dependabot continues to open PRs that bump the stable pin.

Document the pin and the rustup auto-install behaviour in CONTRIBUTING.md.

Closes #487.
Copilot AI review requested due to automatic review settings May 8, 2026 18:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request pins the Rust toolchain to version 1.95.0, documents the toolchain and MSRV policies in the contribution guide, and updates the Dependabot configuration. Feedback indicates that the Dependabot ignore configuration for version 1.85.0 is logically flawed and will not effectively freeze the MSRV pin. Additionally, the reviewer pointed out that workflow files mentioned in the PR description are missing from the current diff, which may lead to inconsistencies.

Comment thread CONTRIBUTING.md Outdated

## Rust Toolchain

`rust-toolchain.toml` pins an exact stable release (currently `1.95.0`); CI uses the same pin so pre-commit's `cargo clippy` runs the identical lint set as CI. `rustup` auto-installs and selects the pinned toolchain on first `cargo` invocation in this repo — no manual `rustup update` needed. Dependabot opens PRs to bump the pin as new stable releases land; bumps go through normal review.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The workflow files (ci.yml, release.yml) mentioned in the PR description are missing from this diff. To maintain consistency with the defined scope of this PR, please ensure these changes are included, or clarify if they are being handled in a separate, concurrent pull request to avoid overlapping modifications.

References
  1. Maintain consistency within a pull request's defined scope; avoid removing or modifying fields that are being addressed in separate, concurrent pull requests.

@thiras thiras May 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ci.yml and release.yml changes are in this PR — git show --stat fdaa8d7 confirms both files were modified in the commit you reviewed (4 ref changes in ci.yml, 2 in release.yml). They show up in git diff main..HEAD --stat on the current tip too. No separate concurrent PR; nothing missing from scope.

Comment thread .github/dependabot.yml Outdated
# Stable pin (currently 1.95.0) IS auto-bumped — only freeze the MSRV version
# so dependabot can still open PRs to advance the stable channel pin.
- dependency-name: "dtolnay/rust-toolchain"
versions: ["1.85.0"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The ignore configuration here does not achieve the goal of "freezing" the MSRV pin while allowing the stable pin to update. Specifying versions: ["1.85.0"] tells Dependabot to ignore version 1.85.0 as an update target, which actually encourages an update to the next available version (e.g., 1.86.0). Furthermore, because Dependabot identifies dependencies by name, any range used to freeze the MSRV pin (like > 1.85.0) would also block updates for the stable pin. You may need to manage these updates manually or use a blanket ignore to keep the pins distinct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct read of the syntax — versions: ["1.85.0"] ignores updates to 1.85.0, not updates from it. The intent of "freeze MSRV but bump stable" can't be expressed cleanly in a single dtolnay/rust-toolchain ignore rule.

Moot at the PR tip: commit 0f023e3 bumps MSRV from 1.85 → 1.95 to match the stable pin and removes the ignore entirely. All five dtolnay/[email protected] refs are now equal and Dependabot will bump them as a group. When MSRV later drops below stable again, this gets revisited — likely with a manual-cadence policy rather than a broken ignore.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Pins the repository’s Rust “stable” toolchain to a specific release so local pre-commit (cargo clippy) and CI run the same compiler/Clippy lint set, avoiding drift-related CI surprises.

Changes:

  • Pin rust-toolchain.toml from stable to 1.95.0.
  • Pin GitHub Actions workflows that used dtolnay/rust-toolchain@stable to @1.95.0 (while keeping the dedicated MSRV job on @1.85.0).
  • Adjust Dependabot rules and contributor documentation to reflect the new toolchain pinning approach.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rust-toolchain.toml Pins local rustup toolchain selection to Rust 1.95.0.
CONTRIBUTING.md Documents the stable pin/MSRV split and expected update cadence.
.github/workflows/release.yml Pins release workflow Rust toolchain setup to 1.95.0.
.github/workflows/ci.yml Pins fmt/clippy/doc/test jobs to 1.95.0 (MSRV job remains 1.85.0).
.github/dependabot.yml Attempts to allow Dependabot to bump the stable toolchain pin while freezing MSRV.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/dependabot.yml Outdated
Comment on lines +23 to +27
# MSRV pin — dtolnay/[email protected] is intentional; see ci.yml msrv job.
# Stable pin (currently 1.95.0) IS auto-bumped — only freeze the MSRV version
# so dependabot can still open PRs to advance the stable channel pin.
- dependency-name: "dtolnay/rust-toolchain"
versions: ["1.85.0"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same point as the other thread, same answer: commit 0f023e3 dropped the ignore when MSRV bumped to 1.95.0 to match the stable pin. Both dtolnay/rust-toolchain refs are now @1.95.0 and Dependabot can bump them in lockstep without any version filter.

Comment thread CONTRIBUTING.md Outdated

## Rust Toolchain

`rust-toolchain.toml` pins an exact stable release (currently `1.95.0`); CI uses the same pin so pre-commit's `cargo clippy` runs the identical lint set as CI. `rustup` auto-installs and selects the pinned toolchain on first `cargo` invocation in this repo — no manual `rustup update` needed. Dependabot opens PRs to bump the pin as new stable releases land; bumps go through normal review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both points are correct. Fixed in 0b23fe8: the paragraph now (a) qualifies the rustup auto-install behaviour (rustup-managed cargo only) and (b) is explicit that Dependabot bumps the GH Actions refs only — rust-toolchain.toml and Cargo.toml's rust-version need a paired manual update in the same PR when accepting a Dependabot toolchain bump.

@github-actions

github-actions Bot commented May 8, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 87.89% (was 87.90%, ● 0.00%) — 11849/13481 lines

File Coverage Lines Δ
crates/cache/src/origin/s3.rs 90.16% 339/376 ▼ 0.03%
crates/cache/src/retry.rs 96.46% 109/113 ▼ 0.88%
crates/cli/src/commands/node.rs 78.25% 439/561 ▲ +0.14%
crates/common/src/config/secret.rs 95.59% 65/68 ● 0.00%
crates/gossip/src/service.rs 30.91% 85/275 ● 0.00%
crates/node/src/runtime/mod.rs 53.60% 372/694 ● 0.00%
History
Commit Total Δ vs base
fdaa8d7 87.90% ● 0.00%
0f023e3 87.89% ● 0.00%
0b23fe8 (HEAD) 87.89% ● 0.00%

Lift workspace `rust-version` from 1.85 to 1.95 so MSRV no longer trails
the stable pin set in the previous commit. The `msrv` CI job stays — its
toolchain ref moves from @1.85.0 to @1.95.0, preserving the symbolic
separation for when MSRV later drops below stable again.

Drop the dependabot `versions: ["1.85.0"]` ignore: with both refs at
@1.95.0, all `dtolnay/rust-toolchain` references should bump in
lockstep.

Bumping MSRV unlocks clippy lints whose suggestions need post-1.85
features:

- `clippy::collapsible_if` (let-chains, stable since 1.88) — collapse
  three nested-`if`/`if-let` blocks in `cache::origin::s3`,
  `cache::retry`, and `cli::commands::node::is_connection_refused`.
- `clippy::duration_suboptimal_units` — replace three
  `Duration::from_secs(60)` constants/literals with
  `Duration::from_mins(1)` (gossip reconnect backoff, dispatch GC
  interval, runtime test).
- `clippy::missing_const_for_fn` — mark `SecretString::is_empty` as
  `const fn`.

Update `CLAUDE.md` and `CONTRIBUTING.md` MSRV mentions to 1.95.
@thiras thiras changed the title build: pin Rust toolchain to 1.95.0 so pre-commit matches CI build: pin Rust toolchain to 1.95.0 and bump MSRV to match May 8, 2026
…scope

The "Rust Toolchain" paragraph asserted rustup auto-installs the pinned
toolchain unconditionally and that Dependabot bumps "the pin" — both
overstated. Rewrite to:

- Qualify the rustup behaviour (rustup-managed cargo only).
- Be explicit that Dependabot updates the GH Actions refs in
  `.github/workflows/`, not `rust-toolchain.toml` or `Cargo.toml`'s
  `rust-version`. Reviewer of a Dependabot toolchain bump PR has to hand-
  edit those two files in the same PR to keep dev machines and CI
  aligned.
@thiras
thiras merged commit 04655f7 into main May 8, 2026
12 checks passed
@thiras
thiras deleted the pin-rust-toolchain branch May 8, 2026 18:50
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.

Pin Rust toolchain so pre-commit clippy matches CI

2 participants