]> git.proxmox.com Git - cargo.git/commitdiff
Error message for package cycles lists the packages in the cycle.
authorGiles Cope <gilescope@gmail.com>
Tue, 6 Mar 2018 00:41:21 +0000 (00:41 +0000)
committerGiles Cope <gilescope@gmail.com>
Tue, 6 Mar 2018 00:41:21 +0000 (00:41 +0000)
src/cargo/core/resolver/mod.rs
tests/testsuite/build.rs

index b5ca6d9cba48af2109df965ea9d1cc0eaf1b129b..402dd42a652d99088f3490a2887dd0922d829a18 100644 (file)
@@ -1491,8 +1491,8 @@ fn check_cycles(resolve: &Resolve, activations: &Activations)
                  -> CargoResult<()> {
         // See if we visited ourselves
         if !visited.insert(id) {
-            bail!("cyclic package dependency: package `{}` depends on itself",
-                  id);
+            bail!("cyclic package dependency: package `{}` depends on itself. Cycle (not in order): {:#?}",
+                  id, visited);
         }
 
         // If we've already checked this node no need to recurse again as we'll
index 51b449af5644bd92310cfcfa7afa73fe3dae655b..d7049befaa06a7fd418e61cbb960340ccf4a44cb 100644 (file)
@@ -1531,9 +1531,8 @@ fn self_dependency() {
         .build();
     assert_that(p.cargo("build"),
                 execs().with_status(101)
-                       .with_stderr("\
-[ERROR] cyclic package dependency: package `test v0.0.0 ([..])` depends on itself
-"));
+                       .with_stderr_contains("\
+[ERROR] cyclic package dependency: package `test v0.0.0 ([..])` depends on itself[..]"));
 }
 
 #[test]
@@ -2652,9 +2651,9 @@ fn cyclic_deps_rejected() {
 
     assert_that(p.cargo("build").arg("-v"),
                 execs().with_status(101)
-                       .with_stderr("\
-[ERROR] cyclic package dependency: package `a v0.0.1 ([..])` depends on itself
-"));
+                       .with_stderr_contains("\
+[ERROR] cyclic package dependency: package `a v0.0.1 ([..]")
+                       .with_stderr_contains("[..]depends on itself[..]"));
 }
 
 #[test]