From 8019922621ec03b36ab026c3cb401dd231185d08 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 6 Apr 2016 18:03:42 +0000 Subject: [PATCH] Fix cargotest --- src/bootstrap/build/check.rs | 13 +++++++++++-- src/bootstrap/build/step.rs | 2 +- src/tools/cargotest/main.rs | 2 +- 3 files changed, 13 insertions(+), 4 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)], diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs index 69ec9299d68..87a01038675 100644 --- a/src/tools/cargotest/main.rs +++ b/src/tools/cargotest/main.rs @@ -19,7 +19,7 @@ use std::io::Write; const TEST_REPOS: &'static [(&'static str, &'static str, Option<&'static str>)] = &[ ("https://github.com/rust-lang/cargo", - "ff02b156f094fb83e70acd965c83c9286411914e", + "fae9c539388f1b7c70c31fd0a21b5dd9cd071177", None), ("https://github.com/iron/iron", "16c858ec2901e2992fe5e529780f59fa8ed12903",