about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-04-09 04:44:43 -0700
committerbors <bors@rust-lang.org>2016-04-09 04:44:43 -0700
commit526f2bf5c534308193246e13ab2da8b3c0cf3cbb (patch)
tree25b36205b027074df078d08c2f3b417f1a52bb92 /src/bootstrap
parent42ea682fc495b6ec362db0aafba69e56c7aa0a9c (diff)
parent8019922621ec03b36ab026c3cb401dd231185d08 (diff)
downloadrust-526f2bf5c534308193246e13ab2da8b3c0cf3cbb.tar.gz
rust-526f2bf5c534308193246e13ab2da8b3c0cf3cbb.zip
Auto merge of #32786 - brson:cargotest, r=alexcrichton
Fix cargotest

Tested in dev.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/build/check.rs13
-rw-r--r--src/bootstrap/build/step.rs2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/bootstrap/build/check.rs b/src/bootstrap/build/check.rs
index 4e2ee475285..a2445ae498a 100644
--- a/src/bootstrap/build/check.rs
+++ b/src/bootstrap/build/check.rs
@@ -18,9 +18,18 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
 }
 
 pub fn cargotest(build: &Build, stage: u32, host: &str) {
+
     let ref compiler = Compiler::new(stage, host);
+
+    // Configure PATH to find the right rustc. NB. we have to use PATH
+    // and not RUSTC because the Cargo test suite has tests that will
+    // fail if rustc is not spelled `rustc`.
+    let path = build.sysroot(compiler).join("bin");
+    let old_path = ::std::env::var("PATH").expect("");
+    let sep = if cfg!(windows) { ";" } else {":" };
+    let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
+
     build.run(build.tool_cmd(compiler, "cargotest")
-              .env("RUSTC", build.compiler_path(compiler))
-              .env("RUSTDOC", build.rustdoc(compiler))
+              .env("PATH", newpath)
               .arg(&build.cargo));
 }
diff --git a/src/bootstrap/build/step.rs b/src/bootstrap/build/step.rs
index a185a65975f..80fcc32e537 100644
--- a/src/bootstrap/build/step.rs
+++ b/src/bootstrap/build/step.rs
@@ -325,7 +325,7 @@ impl<'a> Step<'a> {
                 vec![self.librustc(self.compiler(stage))]
             }
             Source::ToolCargoTest { stage } => {
-                vec![self.libstd(self.compiler(stage))]
+                vec![self.librustc(self.compiler(stage))]
             }
 
             Source::DistDocs { stage } => vec![self.doc(stage)],