Skip to content

Commit 903b4c2

Browse files
committed
Rollup merge of #32786 - brson:cargotest, r=alexcrichton
Fix cargotest Tested in dev.
2 parents ae50375 + d23be87 commit 903b4c2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/bootstrap/build/check.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
1818
}
1919

2020
pub fn cargotest(build: &Build, stage: u32, host: &str) {
21+
2122
let ref compiler = Compiler::new(stage, host);
23+
24+
// Configure PATH to find the right rustc. NB. we have to use PATH
25+
// and not RUSTC because the Cargo test suite has tests that will
26+
// fail if rustc is not spelled `rustc`.
27+
let path = build.sysroot(compiler).join("bin");
28+
let old_path = ::std::env::var("PATH").expect("");
29+
let sep = if cfg!(windows) { ";" } else {":" };
30+
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
31+
2232
build.run(build.tool_cmd(compiler, "cargotest")
23-
.env("RUSTC", build.compiler_path(compiler))
24-
.env("RUSTDOC", build.rustdoc(compiler))
33+
.env("PATH", newpath)
2534
.arg(&build.cargo));
2635
}

src/bootstrap/build/step.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'a> Step<'a> {
319319
vec![self.librustc(self.compiler(stage))]
320320
}
321321
Source::ToolCargoTest { stage } => {
322-
vec![self.libstd(self.compiler(stage))]
322+
vec![self.libtest(self.compiler(stage))]
323323
}
324324

325325
Source::DistDocs { stage } => vec![self.doc(stage)],

src/tools/cargotest/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::io::Write;
1919

2020
const TEST_REPOS: &'static [(&'static str, &'static str, Option<&'static str>)] = &[
2121
("https://github.com/rust-lang/cargo",
22-
"ff02b156f094fb83e70acd965c83c9286411914e",
22+
"fae9c539388f1b7c70c31fd0a21b5dd9cd071177",
2323
None),
2424
("https://github.com/iron/iron",
2525
"16c858ec2901e2992fe5e529780f59fa8ed12903",

0 commit comments

Comments
 (0)