Skip to content

ci: declare MSRV and add MSRV check#925

Closed
DaleSeo wants to merge 2 commits into
mainfrom
ci/add-msrv-check
Closed

ci: declare MSRV and add MSRV check#925
DaleSeo wants to merge 2 commits into
mainfrom
ci/add-msrv-check

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

The project sets edition = "2024" (which requires Rust >= 1.85) but never declared a Minimum Supported Rust Version, so the MSRV was implicit and untested. Downstream consumers had no machine-readable floor, and nothing prevented a change from silently raising it.

This PR:

  • Declares rust-version = "1.88" on [workspace.package] in the root Cargo.toml, and inherits it (rust-version = { workspace = true }) in the published rmcp and rmcp-macros crates so the value actually applies to what's published to crates.io.
  • Adds an MSRV Check CI job that enforces the promise on every push/PR.

Why 1.88?

Edition 2024 sets a hard floor of 1.85. Compiling upward from there in this lockfile, the floor is raised to 1.88 by current dependencies that declare rust-version = "1.88.0" — notably darling, jsonwebtoken, and time. Toolchains 1.85–1.87 fail at the resolver stage; 1.88 is the lowest version where both rmcp (all features except local) and rmcp-macros compile cleanly, so it is the true MSRV.

The toolchain-override pitfall (handled)

The repo's rust-toolchain.toml pins a newer dev toolchain, and that file overrides both rustup default and the toolchain installed by dtolnay/rust-toolchain@<ver> for in-repo cargo invocations. A naive MSRV job would therefore silently test the pinned toolchain instead of the MSRV. To avoid that, the job sets RUSTUP_TOOLCHAIN: "1.88" on the run step (which takes precedence over rust-toolchain.toml) and prints rustc --version so the effective toolchain is visible in logs.

The job stays intentionally minimal (checkout, install toolchain, Swatinem/rust-cache@v2, cargo check) — cargo check for rmcp/rmcp-macros needs no Node/uv/Python setup.

Test plan

  • cargo +1.88 check -p rmcp --features <all-except-local> and cargo +1.88 check -p rmcp-macros both compile cleanly.
  • Confirmed 1.85/1.86/1.87 fail (dependency rust-version requirements force 1.88).
  • Verified cargo metadata reports rust_version=1.88 for both rmcp and rmcp-macros (inheritance works).
  • Verified that with rust-toolchain.toml present, RUSTUP_TOOLCHAIN=1.88 makes rustc report 1.88.0 (job uses the MSRV, not the pinned toolchain).
  • YAML validated with yaml.safe_load.

DaleSeo added 2 commits June 23, 2026 18:56
The workspace declared edition 2024 (which requires Rust >= 1.85) but had
no rust-version, leaving the MSRV implicit. Several dependencies in the
current lockfile (darling, jsonwebtoken, time) require rustc 1.88.0, so the
true floor is 1.88. Declare it on [workspace.package] and inherit it in the
published rmcp and rmcp-macros crates so downstream consumers get an explicit,
machine-readable MSRV.
Add an "MSRV Check" job that runs `cargo check` for rmcp (all features except
local) and rmcp-macros on the declared MSRV toolchain (1.88). Because the
in-repo rust-toolchain.toml pins a newer dev toolchain and would override the
installed toolchain for cargo, the job forces RUSTUP_TOOLCHAIN=1.88 so the
check actually runs on the MSRV rather than the pinned version.
@DaleSeo DaleSeo requested a review from a team as a code owner June 23, 2026 22:57
@github-actions github-actions Bot added T-dependencies Dependencies related changes T-CI Changes to CI/CD workflows and configuration T-config Configuration file changes T-macros Macro changes labels Jun 23, 2026
@DaleSeo DaleSeo closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-CI Changes to CI/CD workflows and configuration T-config Configuration file changes T-dependencies Dependencies related changes T-macros Macro changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant