Skip to content

Commit 7554ba6

Browse files
committed
Migrate more Command usages to BootstrapCmd
1 parent 443afe5 commit 7554ba6

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ impl Step for Extended {
17011701

17021702
let heat_flags = ["-nologo", "-gg", "-sfrag", "-srd", "-sreg"];
17031703
builder.run(
1704-
Command::new(&heat)
1704+
BootstrapCommand::new(&heat)
17051705
.current_dir(&exe)
17061706
.arg("dir")
17071707
.arg("rustc")
@@ -1717,7 +1717,7 @@ impl Step for Extended {
17171717
);
17181718
if built_tools.contains("rust-docs") {
17191719
builder.run(
1720-
Command::new(&heat)
1720+
BootstrapCommand::new(&heat)
17211721
.current_dir(&exe)
17221722
.arg("dir")
17231723
.arg("rust-docs")
@@ -1735,7 +1735,7 @@ impl Step for Extended {
17351735
);
17361736
}
17371737
builder.run(
1738-
Command::new(&heat)
1738+
BootstrapCommand::new(&heat)
17391739
.current_dir(&exe)
17401740
.arg("dir")
17411741
.arg("cargo")
@@ -1752,7 +1752,7 @@ impl Step for Extended {
17521752
.arg(etc.join("msi/remove-duplicates.xsl")),
17531753
);
17541754
builder.run(
1755-
Command::new(&heat)
1755+
BootstrapCommand::new(&heat)
17561756
.current_dir(&exe)
17571757
.arg("dir")
17581758
.arg("rust-std")
@@ -1768,7 +1768,7 @@ impl Step for Extended {
17681768
);
17691769
if built_tools.contains("rust-analyzer") {
17701770
builder.run(
1771-
Command::new(&heat)
1771+
BootstrapCommand::new(&heat)
17721772
.current_dir(&exe)
17731773
.arg("dir")
17741774
.arg("rust-analyzer")
@@ -1787,7 +1787,7 @@ impl Step for Extended {
17871787
}
17881788
if built_tools.contains("clippy") {
17891789
builder.run(
1790-
Command::new(&heat)
1790+
BootstrapCommand::new(&heat)
17911791
.current_dir(&exe)
17921792
.arg("dir")
17931793
.arg("clippy")
@@ -1806,7 +1806,7 @@ impl Step for Extended {
18061806
}
18071807
if built_tools.contains("miri") {
18081808
builder.run(
1809-
Command::new(&heat)
1809+
BootstrapCommand::new(&heat)
18101810
.current_dir(&exe)
18111811
.arg("dir")
18121812
.arg("miri")
@@ -1824,7 +1824,7 @@ impl Step for Extended {
18241824
);
18251825
}
18261826
builder.run(
1827-
Command::new(&heat)
1827+
BootstrapCommand::new(&heat)
18281828
.current_dir(&exe)
18291829
.arg("dir")
18301830
.arg("rust-analysis")
@@ -1842,7 +1842,7 @@ impl Step for Extended {
18421842
);
18431843
if target.ends_with("windows-gnu") {
18441844
builder.run(
1845-
Command::new(&heat)
1845+
BootstrapCommand::new(&heat)
18461846
.current_dir(&exe)
18471847
.arg("dir")
18481848
.arg("rust-mingw")

src/bootstrap/src/core/build_steps/test.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -3141,8 +3141,7 @@ impl Step for RustInstaller {
31413141
return;
31423142
}
31433143

3144-
let mut cmd =
3145-
std::process::Command::new(builder.src.join("src/tools/rust-installer/test.sh"));
3144+
let mut cmd = BootstrapCommand::new(builder.src.join("src/tools/rust-installer/test.sh"));
31463145
let tmpdir = testdir(builder, compiler.host).join("rust-installer");
31473146
let _ = std::fs::remove_dir_all(&tmpdir);
31483147
let _ = std::fs::create_dir_all(&tmpdir);
@@ -3151,7 +3150,7 @@ impl Step for RustInstaller {
31513150
cmd.env("CARGO", &builder.initial_cargo);
31523151
cmd.env("RUSTC", &builder.initial_rustc);
31533152
cmd.env("TMP_DIR", &tmpdir);
3154-
builder.run(BootstrapCommand::from(&mut cmd).delay_failure());
3153+
builder.run(cmd.delay_failure());
31553154
}
31563155

31573156
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -3345,8 +3344,7 @@ impl Step for CodegenCranelift {
33453344
.arg("testsuite.extended_sysroot");
33463345
cargo.args(builder.config.test_args());
33473346

3348-
let mut cmd: Command = cargo.into();
3349-
builder.run(BootstrapCommand::from(&mut cmd));
3347+
builder.run(cargo);
33503348
}
33513349
}
33523350

@@ -3471,7 +3469,6 @@ impl Step for CodegenGCC {
34713469
.arg("--std-tests");
34723470
cargo.args(builder.config.test_args());
34733471

3474-
let mut cmd: Command = cargo.into();
3475-
builder.run(BootstrapCommand::from(&mut cmd));
3472+
builder.run(cargo);
34763473
}
34773474
}

src/bootstrap/src/core/build_steps/tool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ impl Step for LibcxxVersionTool {
836836
}
837837

838838
let compiler = builder.cxx(self.target).unwrap();
839-
let mut cmd = Command::new(compiler);
839+
let mut cmd = BootstrapCommand::new(compiler);
840840

841841
cmd.arg("-o")
842842
.arg(&executable)
843843
.arg(builder.src.join("src/tools/libcxx-version/main.cpp"));
844844

845-
builder.run(BootstrapCommand::from(&mut cmd));
845+
builder.run(cmd);
846846

847847
if !executable.exists() {
848848
panic!("Something went wrong. {} is not present", executable.display());

src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl Build {
576576
};
577577
// NOTE: doesn't use `try_run` because this shouldn't print an error if it fails.
578578
if !update(true).status().map_or(false, |status| status.success()) {
579-
self.run(&mut update(false));
579+
self.run(update(false));
580580
}
581581

582582
// Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error).

0 commit comments

Comments
 (0)