shelbi msrv-check
View as markdownshelbi msrv-check [OPTIONS]shelbi msrv-check builds the Rust workspace in the current directory on the
minimum Rust version it declares (the rust-version in Cargo.toml), the way a
typical CI msrv job does:
cargo +<rust-version> check --workspace --all-targets --lockedIt's meant as a zen.checks.local entry on Rust
projects. A stable-toolchain build won't notice a lockfile change that pulls in
a dependency needing a newer Rust than the declared minimum; this catches it
before handoff instead of only in CI.
It reads rust-version from the nearest Cargo.toml at or above the current
directory. If the toolchain isn't installed it installs it once with rustup.
It never fails for reasons unrelated to the code:
- no
rust-versionfound,rustupmissing, or a toolchain that can't be installed (offline, for example) prints a warning on stderr and exits0(a skip); - a real MSRV break (the check ran and
cargofailed) exits withcargo's non-zero status.
| Variable | Effect |
|---|---|
SHELBI_SKIP_MSRV_CHECK=1 | Skip the check entirely (exit 0). For a host that intentionally doesn't provision the MSRV toolchain. |
SHELBI_MSRV_NO_INSTALL=1 | Never install a missing toolchain; skip instead. The check still runs where the toolchain is already installed. |
msrv-check has no flags of its own beyond the global --root and
-p, --project, which it doesn't use.
Examples
Add it to a project's local Zen checks:
zen:
checks:
local:
- shelbi msrv-checkRun it by hand from the repository root:
shelbi msrv-checkSee also
- Project configuration: where
zen.checks.localis set. - Zen Mode: when local checks run.