ci: declare MSRV and add MSRV check#925
Closed
DaleSeo wants to merge 2 commits into
Closed
Conversation
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.
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.
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:
rust-version = "1.88"on[workspace.package]in the rootCargo.toml, and inherits it (rust-version = { workspace = true }) in the publishedrmcpandrmcp-macroscrates so the value actually applies to what's published to crates.io.MSRV CheckCI 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"— notablydarling,jsonwebtoken, andtime. Toolchains 1.85–1.87 fail at the resolver stage; 1.88 is the lowest version where bothrmcp(all features exceptlocal) andrmcp-macroscompile cleanly, so it is the true MSRV.The toolchain-override pitfall (handled)
The repo's
rust-toolchain.tomlpins a newer dev toolchain, and that file overrides bothrustup defaultand the toolchain installed bydtolnay/rust-toolchain@<ver>for in-repocargoinvocations. A naive MSRV job would therefore silently test the pinned toolchain instead of the MSRV. To avoid that, the job setsRUSTUP_TOOLCHAIN: "1.88"on the run step (which takes precedence overrust-toolchain.toml) and printsrustc --versionso the effective toolchain is visible in logs.The job stays intentionally minimal (checkout, install toolchain,
Swatinem/rust-cache@v2,cargo check) —cargo checkforrmcp/rmcp-macrosneeds no Node/uv/Python setup.Test plan
cargo +1.88 check -p rmcp --features <all-except-local>andcargo +1.88 check -p rmcp-macrosboth compile cleanly.rust-versionrequirements force 1.88).cargo metadatareportsrust_version=1.88for bothrmcpandrmcp-macros(inheritance works).rust-toolchain.tomlpresent,RUSTUP_TOOLCHAIN=1.88makesrustcreport1.88.0(job uses the MSRV, not the pinned toolchain).yaml.safe_load.