-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 error message for cyclic dependencies #7470
Conversation
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
Overall looks reasonable! It is not worth adding a dep just for this but... If we had a dependency on the indexmap crate, A The test suite changes (incorrectly) suggest that a valid impl is just adding a |
First reported in rust-lang/rust#65014 it looks like our error message on cyclic dependencies may be confusing at times. It looks like this is an issue because there are multiple paths through a graph for a dependency, so using the generic `path_to_top` function isn't producing the most useful path for this purpose. We're already walking the graph though, so this commit adds an extra parameter which collects the list of packages we've visited so far to produce a hopefully always-accurate error message showing the chain of dependencies end-to-end for what depends on what.
d418405
to
a92fd48
Compare
Test added! Want to take a second look @Eh2406? |
@bors r+ |
📌 Commit a92fd48 has been approved by |
Improve error message for cyclic dependencies First reported in rust-lang/rust#65014 it looks like our error message on cyclic dependencies may be confusing at times. It looks like this is an issue because there are multiple paths through a graph for a dependency, so using the generic `path_to_top` function isn't producing the most useful path for this purpose. We're already walking the graph though, so this commit adds an extra parameter which collects the list of packages we've visited so far to produce a hopefully always-accurate error message showing the chain of dependencies end-to-end for what depends on what.
☀️ Test successful - checks-azure |
…chton Update cargo, cc, books Update `cc` to include new parallel building support. ## nomicon 3 commits in 4374786f0b4bf0606b35d5c30a9681f342e5707b..5004ad30d69f93553ceef74439fea2159d1f769e 2019-09-17 18:33:21 +0200 to 2019-10-12 19:52:40 +0200 - further clarify C11 and C/C++11 terminology (rust-lang/nomicon#169) - atomics: C11 -> C++20 (rust-lang/nomicon#168) - use sound/unsound terminology ## cargo 12 commits in a429e8cc4614a46a86322a0777a477e2baa83f1c..3a9abe3f065554a7fbc59f440df2baba4a6e47ee 2019-10-04 17:36:12 +0000 to 2019-10-15 15:55:35 +0000 - Fix typo in git index initialization error path (rust-lang/cargo#7512) - Reject feature flags in a virtual workspace. (rust-lang/cargo#7507) - Rename `overrides` to `package` in profiles. (rust-lang/cargo#7504) - Allow publishing with dev-dependencies without a version. (rust-lang/cargo#7333) - Stabilize cache-messages (rust-lang/cargo#7450) - don't lock the package cache when cleaning target dir. (rust-lang/cargo#7502) - Document rustc wrapper (rust-lang/cargo#7499) - Migrate towards exclusively using serde for `Config` (rust-lang/cargo#7456) - Re-enable some MSVC tests. (rust-lang/cargo#7492) - when -Z unstable-options not specified, don't validate --profile (rust-lang/cargo#7489) - Improve error message for cyclic dependencies (rust-lang/cargo#7470) - Some minor clippy fixes. (rust-lang/cargo#7484) ## book 7 commits in 04806c80be0f54b1290287e3f85e84bdfc0b6ec7..9bb8b161963fcebc9d9ccd732ba26f42108016d5 2019-10-01 20:20:22 -0400 to 2019-10-14 18:42:55 -0500 - Make a portion of text less ambiguous (rust-lang/book#2092) - fix heading level (rust-lang/book#2117) - Add missing "of" before `"duck typing"`. (rust-lang/book#1951) - ch18-03: no need to debug print destructured int (rust-lang/book#1991) - Subtle fix to introduce ? on Option in Chapter 9.2 (rust-lang/book#2047) - make wording clearer (rust-lang/book#1976) - Update the version of rand we use ## rust-by-example 5 commits in a6288e7407a6c4c19ea29de6d43f40c803883f21..0b111eaae36cc4b4997684be853882a59e2c7ca7 2019-10-01 10:09:14 -0300 to 2019-10-14 18:34:25 -0300 - Some fix to three files (rust-lang/rust-by-example#1280) - Add reference to Generics (rust-lang/rust-by-example#1281) - Confusing and long sentence (rust-lang/rust-by-example#1282) - Explicit mention of slice range meaning (rust-lang/rust-by-example#1277) - Updated aliasing for nll (rust-lang/rust-by-example#1276)
Update cargo, books ## nomicon 3 commits in 4374786f0b4bf0606b35d5c30a9681f342e5707b..5004ad30d69f93553ceef74439fea2159d1f769e 2019-09-17 18:33:21 +0200 to 2019-10-12 19:52:40 +0200 - further clarify C11 and C/C++11 terminology (rust-lang/nomicon#169) - atomics: C11 -> C++20 (rust-lang/nomicon#168) - use sound/unsound terminology ## cargo 12 commits in a429e8cc4614a46a86322a0777a477e2baa83f1c..3a9abe3f065554a7fbc59f440df2baba4a6e47ee 2019-10-04 17:36:12 +0000 to 2019-10-15 15:55:35 +0000 - Fix typo in git index initialization error path (rust-lang/cargo#7512) - Reject feature flags in a virtual workspace. (rust-lang/cargo#7507) - Rename `overrides` to `package` in profiles. (rust-lang/cargo#7504) - Allow publishing with dev-dependencies without a version. (rust-lang/cargo#7333) - Stabilize cache-messages (rust-lang/cargo#7450) - don't lock the package cache when cleaning target dir. (rust-lang/cargo#7502) - Document rustc wrapper (rust-lang/cargo#7499) - Migrate towards exclusively using serde for `Config` (rust-lang/cargo#7456) - Re-enable some MSVC tests. (rust-lang/cargo#7492) - when -Z unstable-options not specified, don't validate --profile (rust-lang/cargo#7489) - Improve error message for cyclic dependencies (rust-lang/cargo#7470) - Some minor clippy fixes. (rust-lang/cargo#7484) ## book 7 commits in 04806c80be0f54b1290287e3f85e84bdfc0b6ec7..9bb8b161963fcebc9d9ccd732ba26f42108016d5 2019-10-01 20:20:22 -0400 to 2019-10-14 18:42:55 -0500 - Make a portion of text less ambiguous (rust-lang/book#2092) - fix heading level (rust-lang/book#2117) - Add missing "of" before `"duck typing"`. (rust-lang/book#1951) - ch18-03: no need to debug print destructured int (rust-lang/book#1991) - Subtle fix to introduce ? on Option in Chapter 9.2 (rust-lang/book#2047) - make wording clearer (rust-lang/book#1976) - Update the version of rand we use ## rust-by-example 5 commits in a6288e7407a6c4c19ea29de6d43f40c803883f21..0b111eaae36cc4b4997684be853882a59e2c7ca7 2019-10-01 10:09:14 -0300 to 2019-10-14 18:34:25 -0300 - Some fix to three files (rust-lang/rust-by-example#1280) - Add reference to Generics (rust-lang/rust-by-example#1281) - Confusing and long sentence (rust-lang/rust-by-example#1282) - Explicit mention of slice range meaning (rust-lang/rust-by-example#1277) - Updated aliasing for nll (rust-lang/rust-by-example#1276)
First reported in rust-lang/rust#65014 it looks like our error message
on cyclic dependencies may be confusing at times. It looks like this is
an issue because there are multiple paths through a graph for a
dependency, so using the generic
path_to_top
function isn't producingthe most useful path for this purpose.
We're already walking the graph though, so this commit adds an extra
parameter which collects the list of packages we've visited so far to
produce a hopefully always-accurate error message showing the chain of
dependencies end-to-end for what depends on what.