Skip to content

chore(ci): decouple MSRV from the development toolchain - #3180

Merged
WesleyRosenblum merged 3 commits into
mainfrom
WesleyRosenblum/decoupleMsrv
Aug 3, 2026
Merged

chore(ci): decouple MSRV from the development toolchain#3180
WesleyRosenblum merged 3 commits into
mainfrom
WesleyRosenblum/decoupleMsrv

Conversation

@WesleyRosenblum

@WesleyRosenblum WesleyRosenblum commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Release Summary:

Resolved issues:

N/A

Description of changes:

rust-toolchain pinned the repository to its MSRV, and CI parsed the MSRV back out of rustup show active-toolchain. That forced every contributor onto the MSRV toolchain, which rust-analyzer no longer supports: it requires 1.94.0 or newer and misresolves std macros against older sysroots.

CI now derives the MSRV from the rust-version field each crate already declares, and the three rust-toolchain files are removed. The MSRV is unchanged at 1.92 and the test matrix still verifies it explicitly.

No CI job depended on those files; every job that compiles Rust installs and overrides its own toolchain. The deny job's rm rust-toolchain step is dropped since rm fails on a missing file, and CONTRIBUTING.md now documents the development toolchain. tools/xdp/ebpf keeps its nightly pin, which is a build requirement (-Zbuild-std for a tier 3 target), not an MSRV.

Call-outs:

  • MSRV violations are still caught locally by clippy's incompatible_msrv lint, already configured through .clippy.toml. It covers library APIs but not language features, so the MSRV matrix job remains the authority.
  • CI now fails if a crate declares a rust-version below the MSRV. Declaring higher is allowed on purpose: tools/xdp and dc/wireshark both sat above the repository MSRV for long stretches while their dependencies outpaced it.

Testing:

  • cargo check --workspace passes on stable (1.97.1) and on 1.92.0 with identical warnings.
  • The eBPF build still selects its pinned nightly and compiles.
  • MSRV derivation yields msrv=1.92 and versions=["stable","beta","1.92"]. The floor check passes today, passes when a crate is raised above the MSRV, and fails when one drops below it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

`rust-toolchain` pinned the MSRV, and CI recovered the MSRV by parsing
`rustup show active-toolchain`. That coupling forced every contributor's
toolchain to the MSRV, which is now old enough that current tooling refuses
to work against it: rust-analyzer requires 1.94.0 or newer and misresolves
std macros on older sysroots.

Point `rust-toolchain` at stable and derive the MSRV in CI from the
`rust-version` field that every crate already declares. The MSRV itself is
unchanged at 1.92, and the test matrix still builds and tests against it
explicitly.

MSRV enforcement continues locally through clippy's `incompatible_msrv`
lint, which is warn by default, denied in CI via `-D warnings`, and already
configured by the `msrv` key in the `.clippy.toml` files. That covers use of
library APIs stabilized after the MSRV, but not newer language features, so
the MSRV matrix job remains the authority.

Because nothing pins the MSRV in a single place anymore, the definitions
step now fails if the crates stop agreeing on a `rust-version` rather than
silently testing whichever version the parsed crate happened to declare.

The nightly pin in tools/xdp/ebpf is left alone; it is a build requirement
for the eBPF programs rather than an MSRV.
The previous check required every crate to declare an identical
`rust-version`, which would reject a pattern this repository has relied on
before: the xdp and wireshark workspaces both carried a higher minimum than
the repository MSRV while their dependencies outpaced it, and they are the
crates most likely to need that again.

Check the actual invariant instead. The MSRV is the floor s2n-quic promises,
so no crate may declare lower than it, while a crate requiring a higher
version is fine.
With the MSRV no longer expressed by these files, they served no purpose. No
CI job depended on them: every job that compiles Rust installs and overrides
its own toolchain, and the ones that don't (env, compliance, copyright, kani,
ci-status-report) never invoke rustc. Two places already worked around the
files instead of relying on them: the cargo-deny job deleted the root file
before running, and .dockerignore excludes it from the build context.

Drop the now-failing `rm rust-toolchain` step from the cargo-deny job, since
`rm` errors on a missing file, and document the development toolchain in
CONTRIBUTING to replace the components the files installed.

tools/xdp/ebpf/rust-toolchain.toml stays. That pin is a build requirement
rather than an MSRV statement: the bpf targets are tier 3 with no prebuilt
`rust-std`, so `core` has to be compiled from source with `-Zbuild-std`,
which is still nightly only.
@WesleyRosenblum WesleyRosenblum changed the title Decouple the MSRV from the development toolchain chore(ci): decouple MSRV from the development toolchain Jul 31, 2026
@WesleyRosenblum
WesleyRosenblum marked this pull request as ready for review July 31, 2026 23:16
@WesleyRosenblum
WesleyRosenblum requested review from a team as code owners July 31, 2026 23:16
@WesleyRosenblum
WesleyRosenblum merged commit e2b404a into main Aug 3, 2026
137 of 138 checks passed
@WesleyRosenblum
WesleyRosenblum deleted the WesleyRosenblum/decoupleMsrv branch August 3, 2026 16:51
dougch added a commit to awslabs/duvet that referenced this pull request Aug 5, 2026
* ci: remove rust-toolchain pin; derive MSRV from Cargo.toml

The repo-root `rust-toolchain` file pinned the toolchain to 1.88.0.
rust-analyzer requires 1.94.0 or newer and refuses to work against a
1.88 sysroot, producing "too old" pop-ups for any developer running a
recent rust-analyzer build.

The MSRV is already correctly declared via `rust-version = "1.88"` in
each crate's Cargo.toml, so the toolchain file was redundant for that
purpose and harmful for local tooling.

- Delete `rust-toolchain` so rust-analyzer uses the developer's
  installed stable toolchain
- Update CI MSRV derivation to read from `duvet/Cargo.toml` directly
  instead of parsing `rustup show active-toolchain` (which read the
  now-deleted toolchain file)
- Add `rust-version = "1.88"` to `xtask/Cargo.toml` for consistency

Mirrors the fix applied in aws/s2n-quic#3180.

* ci: remove stale 'Remove rust-toolchain' step from dependencies workflow
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.

3 participants