Skip to content

Commit f10f18d

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. In addition to making complementary changes to the `msrv.yml` workflow and to the `justfile` recipe it uses, this also changes the `Makefile` rule corresponding to the `justfile` recipe, so they continue to do the same thing if used in local experiments.
1 parent 4af6ef9 commit f10f18d

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
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

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ bench-gix-config:
126126

127127
check-msrv-on-ci: ## Check the minimal support rust version for currently installed Rust version
128128
rustc --version
129-
cargo check --package gix
130-
cargo check --package gix --no-default-features --features async-network-client,max-performance
129+
cargo check --locked --package gix
130+
cargo check --locked --package gix --no-default-features --features async-network-client,max-performance
131131

132132
##@ Maintenance
133133

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)