Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve resolver message to include dependency requirements #9827

Merged
merged 4 commits into from
Aug 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests to display dep-req info for dep-chain
weihanglo committed Aug 23, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
weihanglo Weihang Lo
commit 0afd40b4de17a5c45145a0762beb4ef001720fe1
4 changes: 2 additions & 2 deletions crates/resolver-tests/tests/resolve.rs
Original file line number Diff line number Diff line change
@@ -1498,7 +1498,7 @@ fn cyclic_good_error_message() {
assert_eq!("\
cyclic package dependency: package `A v0.0.0 (registry `https://example.com/`)` depends on itself. Cycle:
package `A v0.0.0 (registry `https://example.com/`)`
... which is depended on by `C v0.0.0 (registry `https://example.com/`)`
... which is depended on by `A v0.0.0 (registry `https://example.com/`)`\
... which satisfies dependency `A = \"*\"` of package `C v0.0.0 (registry `https://example.com/`)`
... which satisfies dependency `C = \"*\"` of package `A v0.0.0 (registry `https://example.com/`)`\
", error.to_string());
}
20 changes: 10 additions & 10 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
@@ -1096,14 +1096,14 @@ fn incompatible_dependencies() {
"\
error: failed to select a version for `bad`.
... required by package `qux v0.1.0`
... which is depended on by `foo v0.0.1 ([..])`
... which satisfies dependency `qux = \"^0.1.0\"` of package `foo v0.0.1 ([..])`
versions that meet the requirements `>=1.0.1` are: 1.0.2, 1.0.1
all possible versions conflict with previously selected packages.
previously selected package `bad v1.0.0`
... which is depended on by `baz v0.1.0`
... which is depended on by `foo v0.0.1 ([..])`
... which satisfies dependency `bad = \"=1.0.0\"` of package `baz v0.1.0`
... which satisfies dependency `baz = \"^0.1.0\"` of package `foo v0.0.1 ([..])`
failed to select a version for `bad` which could resolve this conflict",
)
@@ -1147,12 +1147,12 @@ versions that meet the requirements `>=1.0.1, <=2.0.0` are: 2.0.0, 1.0.1
all possible versions conflict with previously selected packages.
previously selected package `bad v2.0.1`
... which is depended on by `baz v0.1.0`
... which is depended on by `foo v0.0.1 ([..])`
... which satisfies dependency `bad = \">=2.0.1\"` of package `baz v0.1.0`
... which satisfies dependency `baz = \"^0.1.0\"` of package `foo v0.0.1 ([..])`
previously selected package `bad v1.0.0`
... which is depended on by `bar v0.1.0`
... which is depended on by `foo v0.0.1 ([..])`
... which satisfies dependency `bad = \"=1.0.0\"` of package `bar v0.1.0`
... which satisfies dependency `bar = \"^0.1.0\"` of package `foo v0.0.1 ([..])`
failed to select a version for `bad` which could resolve this conflict",
)
@@ -1662,7 +1662,7 @@ fn self_dependency() {
"\
[ERROR] cyclic package dependency: package `test v0.0.0 ([CWD])` depends on itself. Cycle:
package `test v0.0.0 ([CWD])`
... which is depended on by `test v0.0.0 ([..])`",
... which satisfies path dependency `test` of package `test v0.0.0 ([..])`",
)
.run();
}
@@ -2808,8 +2808,8 @@ fn cyclic_deps_rejected() {
.with_stderr(
"[ERROR] cyclic package dependency: package `a v0.0.1 ([CWD]/a)` depends on itself. Cycle:
package `a v0.0.1 ([CWD]/a)`
... which is depended on by `foo v0.0.1 ([CWD])`
... which is depended on by `a v0.0.1 ([..])`",
... which satisfies path dependency `a` of package `foo v0.0.1 ([CWD])`
... which satisfies path dependency `foo` of package `a v0.0.1 ([..])`",
).run();
}

2 changes: 1 addition & 1 deletion tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
@@ -1064,7 +1064,7 @@ fn links_duplicates_deep_dependency() {
.with_stderr("\
error: failed to select a version for `a-sys`.
... required by package `a v0.5.0 ([..])`
... which is depended on by `foo v0.5.0 ([..])`
... which satisfies path dependency `a` of package `foo v0.5.0 ([..])`
versions that meet the requirements `*` are: 0.5.0
the package `a-sys` links to the native library `a`, but it conflicts with a previous package which links to `a` as well:
6 changes: 3 additions & 3 deletions tests/testsuite/patch.rs
Original file line number Diff line number Diff line change
@@ -1618,10 +1618,10 @@ fn cycle() {
.with_stderr(
"\
[UPDATING] [..]
error: cyclic package dependency: [..]
[ERROR] cyclic package dependency: [..]
package `[..]`
... which is depended on by `[..]`
... which is depended on by `[..]`
... which satisfies dependency `[..]` of package `[..]`
... which satisfies dependency `[..]` of package `[..]`
",
)
.run();
4 changes: 2 additions & 2 deletions tests/testsuite/path.rs
Original file line number Diff line number Diff line change
@@ -1046,8 +1046,8 @@ fn deep_path_error() {
.with_stderr(
"\
[ERROR] failed to get `c` as a dependency of package `b v0.1.0 [..]`
... which is depended on by `a v0.1.0 [..]`
... which is depended on by `foo v0.1.0 [..]`
... which satisfies path dependency `b` of package `a v0.1.0 [..]`
... which satisfies path dependency `a` of package `foo v0.1.0 [..]`
Caused by:
failed to load source for dependency `c`
2 changes: 1 addition & 1 deletion tests/testsuite/registry.rs
Original file line number Diff line number Diff line change
@@ -547,7 +547,7 @@ error: failed to select a version for the requirement `baz = \"=0.0.2\"`
candidate versions found which didn't match: 0.0.1
location searched: `[..]` index (which is replacing registry `[..]`)
required by package `bar v0.0.1`
... which is depended on by `foo [..]`
... which satisfies dependency `bar = \"*\"` of package `foo [..]`
",
)
.run();