about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2016-04-06 18:03:42 +0000
committerBrian Anderson <banderson@mozilla.com>2016-04-07 22:45:45 +0000
commit8019922621ec03b36ab026c3cb401dd231185d08 (patch)
tree48c1f9327036d0c3dd464b832addaab3dbb8e42c /src/bootstrap
parent943ec3bdfc9ba28e94b6d00a2b53fb2cd8b21655 (diff)
Fix cargotest
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 4e3aacd3720..ace0398cb24 100644
--- a/src/bootstrap/build/step.rs
+++ b/src/bootstrap/build/step.rs
@@ -319,7 +319,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)],