Skip to content

Commit dc295c8

Browse files
committed
feat(install): Including Locking message
As we switch to MSRV-aware resolver, this will help users work out why MSRV-aware resolving isn't helping them. This will also make it more obvious if we breaking things when developing the MSRV-aware resolver.
1 parent eb0726d commit dc295c8

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

src/cargo/ops/resolve.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ pub fn resolve_ws_with_opts<'gctx>(
147147
specs,
148148
add_patches,
149149
)?;
150+
ops::print_lockfile_changes(ws, None, &resolved_with_overrides, &mut registry)?;
150151
(resolve, resolved_with_overrides)
151152
} else if ws.require_optional_deps() {
152153
// First, resolve the root_package's *listed* dependencies, as well as
@@ -205,6 +206,8 @@ pub fn resolve_ws_with_opts<'gctx>(
205206
specs,
206207
add_patches,
207208
)?;
209+
// Skipping `print_lockfile_changes` as there are cases where this prints irrelevant
210+
// information
208211
(resolve, resolved_with_overrides)
209212
};
210213

tests/testsuite/directory.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ fn simple_install() {
148148
.with_stderr(
149149
"\
150150
[INSTALLING] bar v0.1.0
151+
[LOCKING] 2 packages to latest compatible versions
151152
[COMPILING] foo v0.0.1
152153
[COMPILING] bar v0.1.0
153154
[FINISHED] `release` profile [optimized] target(s) in [..]s
@@ -243,6 +244,7 @@ fn install_without_feature_dep() {
243244
.with_stderr(
244245
"\
245246
[INSTALLING] bar v0.1.0
247+
[LOCKING] 2 packages to latest compatible versions
246248
[COMPILING] foo v0.0.1
247249
[COMPILING] bar v0.1.0
248250
[FINISHED] `release` profile [optimized] target(s) in [..]s

tests/testsuite/install.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,8 @@ fn self_referential() {
24102410
[DOWNLOADING] crates ...
24112411
[DOWNLOADED] foo v0.0.2 (registry [..])
24122412
[INSTALLING] foo v0.0.2
2413+
[LOCKING] 2 packages to latest compatible versions
2414+
[ADDING] foo v0.0.1 (latest: v0.0.2)
24132415
[DOWNLOADING] crates ...
24142416
[DOWNLOADED] foo v0.0.1 (registry [..])
24152417
[COMPILING] foo v0.0.1
@@ -2455,6 +2457,7 @@ fn ambiguous_registry_vs_local_package() {
24552457
"\
24562458
[INSTALLING] foo v0.1.0 ([..])
24572459
[UPDATING] `[..]` index
2460+
[LOCKING] 2 packages to latest compatible versions
24582461
[DOWNLOADING] crates ...
24592462
[DOWNLOADED] foo v0.0.1 (registry [..])
24602463
[COMPILING] foo v0.0.1

tests/testsuite/publish_lockfile.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ dependencies = [
415415
"\
416416
[UPDATING] `[..]` index
417417
[INSTALLING] foo v0.1.0
418+
[LOCKING] 2 packages to latest compatible versions
418419
[DOWNLOADING] crates ...
419420
[DOWNLOADED] bar v0.1.1 (registry `[..]`)
420421
[COMPILING] bar v0.1.1

tests/testsuite/required_features.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ Consider enabling them by passing, e.g., `--features=\"bar/a\"`
11291129
.with_stderr(
11301130
"\
11311131
[INSTALLING] foo v0.0.1 ([..])
1132+
[LOCKING] 2 packages to latest compatible versions
11321133
[FINISHED] `release` profile [optimized] target(s) in [..]
11331134
[WARNING] none of the package's binaries are available for install using the selected features
11341135
bin \"foo\" requires the features: `bar/a`

0 commit comments

Comments
 (0)