Fix can_run_doc_tests order depends on hash.
authorEric Huss <eric@huss.org>
Sun, 4 Nov 2018 18:38:51 +0000 (10:38 -0800)
committerXimin Luo <infinity0@debian.org>
Thu, 24 Jan 2019 08:29:51 +0000 (08:29 +0000)
The deps are sorted, but the name is the same so the order depends on the metadata hash.
Fix by sorting by the actual name, too.

Gbp-Pq: Name 1002_fix_doc_tests_order_hash.patch

src/cargo/core/compiler/context/mod.rs
tests/testsuite/rename_deps.rs

index 225e6ebd53f6b914d8cf9fa18b82da95adc1340d..334a3876aa9cc5de193bf3ae20e388e938055bbd 100644 (file)
@@ -234,6 +234,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
                         }
                     }
                 }
+                // Help with tests to get a stable order with renamed deps.
+                doctest_deps.sort();
                 self.compilation.to_doc_test.push(compilation::Doctest {
                     package: unit.pkg.clone(),
                     target: unit.target.clone(),
index b70c8e824e23fdcfe6ac7be508df6f6421fb6d78..c8ee06dbcaaa9cf6c5690fb71f6023a305c98af0 100644 (file)
@@ -254,8 +254,8 @@ fn can_run_doc_tests() {
 [DOCTEST] foo
 [RUNNING] `rustdoc --test [CWD]/src/lib.rs \
         [..] \
-        --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \
         --extern bar=[CWD]/target/debug/deps/libbar-[..].rlib \
+        --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \
         [..]`
 ",
         ).run();