bootstrap: use prepare_tool_cargo everywhere
In this way, RUSTC_NO_PREFER_DYNAMIC is already specified and not needed.
This commit is contained in:
parent
c6d28442e8
commit
a89f8e1340
1 changed files with 22 additions and 24 deletions
|
@ -222,17 +222,18 @@ impl Step for Cargo {
|
||||||
compiler,
|
compiler,
|
||||||
target: self.host,
|
target: self.host,
|
||||||
});
|
});
|
||||||
let mut cargo = builder.cargo(compiler, Mode::ToolRustc, self.host, "test");
|
let mut cargo = tool::prepare_tool_cargo(builder,
|
||||||
cargo
|
compiler,
|
||||||
.arg("--manifest-path")
|
Mode::ToolRustc,
|
||||||
.arg(builder.src.join("src/tools/cargo/Cargo.toml"));
|
self.host,
|
||||||
|
"test",
|
||||||
|
"src/tools/cargo",
|
||||||
|
true);
|
||||||
|
|
||||||
if !builder.fail_fast {
|
if !builder.fail_fast {
|
||||||
cargo.arg("--no-fail-fast");
|
cargo.arg("--no-fail-fast");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't build tests dynamically, just a pain to work with
|
|
||||||
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
|
||||||
|
|
||||||
// Don't run cross-compile tests, we may not have cross-compiled libstd libs
|
// Don't run cross-compile tests, we may not have cross-compiled libstd libs
|
||||||
// available.
|
// available.
|
||||||
cargo.env("CFG_DISABLE_CROSS_TESTS", "1");
|
cargo.env("CFG_DISABLE_CROSS_TESTS", "1");
|
||||||
|
@ -289,9 +290,6 @@ impl Step for Rls {
|
||||||
"src/tools/rls",
|
"src/tools/rls",
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// Don't build tests dynamically, just a pain to work with
|
|
||||||
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
|
||||||
|
|
||||||
builder.add_rustc_lib_path(compiler, &mut cargo);
|
builder.add_rustc_lib_path(compiler, &mut cargo);
|
||||||
|
|
||||||
if try_run(builder, &mut cargo) {
|
if try_run(builder, &mut cargo) {
|
||||||
|
@ -345,8 +343,6 @@ impl Step for Rustfmt {
|
||||||
"src/tools/rustfmt",
|
"src/tools/rustfmt",
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// Don't build tests dynamically, just a pain to work with
|
|
||||||
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
|
||||||
let dir = testdir(builder, compiler.host);
|
let dir = testdir(builder, compiler.host);
|
||||||
t!(fs::create_dir_all(&dir));
|
t!(fs::create_dir_all(&dir));
|
||||||
cargo.env("RUSTFMT_TEST_DIR", dir);
|
cargo.env("RUSTFMT_TEST_DIR", dir);
|
||||||
|
@ -394,13 +390,14 @@ impl Step for Miri {
|
||||||
extra_features: Vec::new(),
|
extra_features: Vec::new(),
|
||||||
});
|
});
|
||||||
if let Some(miri) = miri {
|
if let Some(miri) = miri {
|
||||||
let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "test");
|
let mut cargo = tool::prepare_tool_cargo(builder,
|
||||||
cargo
|
compiler,
|
||||||
.arg("--manifest-path")
|
Mode::ToolRustc,
|
||||||
.arg(builder.src.join("src/tools/miri/Cargo.toml"));
|
host,
|
||||||
|
"test",
|
||||||
|
"src/tools/miri",
|
||||||
|
true);
|
||||||
|
|
||||||
// Don't build tests dynamically, just a pain to work with
|
|
||||||
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
|
||||||
// miri tests need to know about the stage sysroot
|
// miri tests need to know about the stage sysroot
|
||||||
cargo.env("MIRI_SYSROOT", builder.sysroot(compiler));
|
cargo.env("MIRI_SYSROOT", builder.sysroot(compiler));
|
||||||
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
|
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
|
||||||
|
@ -452,13 +449,14 @@ impl Step for Clippy {
|
||||||
extra_features: Vec::new(),
|
extra_features: Vec::new(),
|
||||||
});
|
});
|
||||||
if let Some(clippy) = clippy {
|
if let Some(clippy) = clippy {
|
||||||
let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "test");
|
let mut cargo = tool::prepare_tool_cargo(builder,
|
||||||
cargo
|
compiler,
|
||||||
.arg("--manifest-path")
|
Mode::ToolRustc,
|
||||||
.arg(builder.src.join("src/tools/clippy/Cargo.toml"));
|
host,
|
||||||
|
"test",
|
||||||
|
"src/tools/clippy",
|
||||||
|
true);
|
||||||
|
|
||||||
// Don't build tests dynamically, just a pain to work with
|
|
||||||
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
|
|
||||||
// clippy tests need to know about the stage sysroot
|
// clippy tests need to know about the stage sysroot
|
||||||
cargo.env("SYSROOT", builder.sysroot(compiler));
|
cargo.env("SYSROOT", builder.sysroot(compiler));
|
||||||
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
|
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue