Skip to content

Commit 526f2bf

Browse files
committed
Auto merge of #32786 - brson:cargotest, r=alexcrichton
Fix cargotest Tested in dev.
2 parents 42ea682 + 8019922 commit 526f2bf

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Diff for: 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
}

Diff for: src/bootstrap/build/step.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl<'a> Step<'a> {
325325
vec![self.librustc(self.compiler(stage))]
326326
}
327327
Source::ToolCargoTest { stage } => {
328-
vec![self.libstd(self.compiler(stage))]
328+
vec![self.librustc(self.compiler(stage))]
329329
}
330330

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

Diff for: 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)