Skip to content

Commit 43b4033

Browse files
committed
Use --locked instead of checking Cargo.lock afterwards
The verification being done here is exactly what `--locked` is for. Allowing the check to proceed even if it changes the dependencies could have the benefit of showing more information. But it is not obvious that the information it shows would be relevant to the situation being investigated. (If that information would usually be relevant, then `cargo +nightly update -Zminimal-versions` may be too strong, and `cargo +nightly update -Zdirect-minimal-versions` could be considered. Even better than either of those *might* be, somehow, to temporarily downgrade locked dependencies only as much as necessary to make them all MSRV-compatible.) In any case, `--locked` is more readable, and considerably simpler.
1 parent 6f7f2ed commit 43b4033

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

.github/workflows/msrv.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,5 @@ jobs:
4848
- name: Downgrade locked dependencies to lowest allowed versions
4949
run: |
5050
cargo +nightly update -Zminimal-versions # TODO(msrv): Use non-`-Z` way when available.
51-
git add Cargo.lock # Stage for a later `git diff` check.
5251
- name: Run some `cargo check` commands on `gix`
5352
run: just ci-check-msrv
54-
- name: Check `cargo` didn't have to change the versions
55-
run: git diff --exit-code -- Cargo.lock

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ check-size:
246246
# Check the MSRV, *if* the toolchain is set and `Cargo.lock` is downgraded (used on CI)
247247
ci-check-msrv:
248248
rustc --version
249-
cargo check -p gix
250-
cargo check -p gix --no-default-features --features async-network-client,max-performance
249+
cargo check --locked -p gix
250+
cargo check --locked -p gix --no-default-features --features async-network-client,max-performance
251251

252252
# Enter a nix-shell able to build on macOS
253253
nix-shell-macos:

0 commit comments

Comments
 (0)