Skip to content

Conversation

huitseeker
Copy link
Contributor

@huitseeker huitseeker commented Sep 28, 2025

On top of #2229. This is essentially a port of 0xMiden/crypto#547 on this repo.

Copying the PR description from there.


This adds a CI job (locally runnable) that will check the MSRV of a PR is set correctly on a crate-by-crate basis. If the MSRV is set incorrectly, due to e.g. some feature being used, it will compute the correct MSRV for that crate and indicate it in its error.

The script's error message can be emulated by manually changing the MSRV to an incorrect version (e.g. "1.87") and running it (./scripts/check-msrv.sh).

Sample output (click to unfold)
Checking MSRV for workspace members...
Checking miden-crypto in /Users/huitseeker/tmp/crypto/miden-crypto
   Current MSRV: 1.87
ERROR: MSRV check failed for miden-crypto
Searching for correct MSRV for miden-crypto...
   Found actual MSRV: 1.88.0

ERROR SUMMARY for miden-crypto:
   Package:   miden-crypto
   Directory: /Users/huitseeker/tmp/crypto/miden-crypto
   Current (incorrect) MSRV: 1.87
   Correct MSRV:             1.88.0

TO FIX:
   Update rust-version in /Users/huitseeker/tmp/crypto/miden-crypto/Cargo.
toml from "1.87" to "1.88.0"

   Or run this command (portable in-place edit):
     sed_i 's/^\s*rust-version\s*=\s*"1.87"/rust-version = "1.88.0"/' "/Us
ers/huitseeker/tmp/crypto/miden-crypto/Cargo.toml"
--------------------------------------------------------------------------
-----

This further adds a rust-toolchain file that will make CI tooling (and local rustup dev envs) follow the latest stable as it updates.

As a consequence, the following behaviors can change from being proactive to being on-demand:

  • bumping the MSRV.

As a side effect, we can expect the MSRV setting to (over time) accurately reflect what we can compile with. Right now, the project or any of its dependents cannot be compiled with Rust 1.88 (and there is not technical reason to impose this restriction).


The local difference is this project has an MSRV of 1.90 (and the current PR does not modify it). The toolchain file bumps CI to 1.90.

@huitseeker huitseeker added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Sep 28, 2025
@huitseeker huitseeker force-pushed the huiseeker/msrv-toolchain branch from 6a4cf08 to b29a4be Compare September 28, 2025 08:24
@huitseeker huitseeker changed the title Ci: drive CI with rust-toolchain.yml, add MSRV adjustment automation ci: drive CI with rust-toolchain.yml, add MSRV adjustment automation Sep 28, 2025
@huitseeker huitseeker changed the base branch from next to huitseeker/docfix September 28, 2025 08:29
Base automatically changed from huitseeker/docfix to next September 28, 2025 08:39
@@ -0,0 +1,5 @@
[toolchain]
channel = "stable"
Copy link
Collaborator

Choose a reason for hiding this comment

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

My only suggestion is that we set this to our current desired MSRV toolchain, e.g. "1.90" or "1.88", or whatever makes the most sense.

This will ensure that building/testing the project from the repo will always use the exact same toolchain, as opposed to whatever stable happens to mean at the moment on the persons machine (or in CI)

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I've pushed a small commit to change the channel to 1.90 as we did in miden-crypto - other than that, I think this is ready to go.

@bobbinth bobbinth merged commit 18d9a3e into next Sep 28, 2025
15 checks passed
@bobbinth bobbinth deleted the huiseeker/msrv-toolchain branch September 28, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR does not require an entry in the `CHANGELOG.md` file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants