Skip to content

Commit 2ebfcce

Browse files
committed
Migrate more Command usages to BootstrapCmd
1 parent bed2cbd commit 2ebfcce

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

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

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

17061706
let heat_flags = ["-nologo", "-gg", "-sfrag", "-srd", "-sreg"];
17071707
builder.run(
1708-
Command::new(&heat)
1708+
BootstrapCommand::new(&heat)
17091709
.current_dir(&exe)
17101710
.arg("dir")
17111711
.arg("rustc")
@@ -1721,7 +1721,7 @@ impl Step for Extended {
17211721
);
17221722
if built_tools.contains("rust-docs") {
17231723
builder.run(
1724-
Command::new(&heat)
1724+
BootstrapCommand::new(&heat)
17251725
.current_dir(&exe)
17261726
.arg("dir")
17271727
.arg("rust-docs")
@@ -1739,7 +1739,7 @@ impl Step for Extended {
17391739
);
17401740
}
17411741
builder.run(
1742-
Command::new(&heat)
1742+
BootstrapCommand::new(&heat)
17431743
.current_dir(&exe)
17441744
.arg("dir")
17451745
.arg("cargo")
@@ -1756,7 +1756,7 @@ impl Step for Extended {
17561756
.arg(etc.join("msi/remove-duplicates.xsl")),
17571757
);
17581758
builder.run(
1759-
Command::new(&heat)
1759+
BootstrapCommand::new(&heat)
17601760
.current_dir(&exe)
17611761
.arg("dir")
17621762
.arg("rust-std")
@@ -1772,7 +1772,7 @@ impl Step for Extended {
17721772
);
17731773
if built_tools.contains("rust-analyzer") {
17741774
builder.run(
1775-
Command::new(&heat)
1775+
BootstrapCommand::new(&heat)
17761776
.current_dir(&exe)
17771777
.arg("dir")
17781778
.arg("rust-analyzer")
@@ -1791,7 +1791,7 @@ impl Step for Extended {
17911791
}
17921792
if built_tools.contains("clippy") {
17931793
builder.run(
1794-
Command::new(&heat)
1794+
BootstrapCommand::new(&heat)
17951795
.current_dir(&exe)
17961796
.arg("dir")
17971797
.arg("clippy")
@@ -1810,7 +1810,7 @@ impl Step for Extended {
18101810
}
18111811
if built_tools.contains("miri") {
18121812
builder.run(
1813-
Command::new(&heat)
1813+
BootstrapCommand::new(&heat)
18141814
.current_dir(&exe)
18151815
.arg("dir")
18161816
.arg("miri")
@@ -1828,7 +1828,7 @@ impl Step for Extended {
18281828
);
18291829
}
18301830
builder.run(
1831-
Command::new(&heat)
1831+
BootstrapCommand::new(&heat)
18321832
.current_dir(&exe)
18331833
.arg("dir")
18341834
.arg("rust-analysis")
@@ -1846,7 +1846,7 @@ impl Step for Extended {
18461846
);
18471847
if target.ends_with("windows-gnu") {
18481848
builder.run(
1849-
Command::new(&heat)
1849+
BootstrapCommand::new(&heat)
18501850
.current_dir(&exe)
18511851
.arg("dir")
18521852
.arg("rust-mingw")

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

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

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

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

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

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

3475-
let mut cmd: Command = cargo.into();
3476-
builder.run(BootstrapCommand::from(&mut cmd));
3473+
builder.run(cargo);
34773474
}
34783475
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,13 @@ impl Step for LibcxxVersionTool {
912912
}
913913

914914
let compiler = builder.cxx(self.target).unwrap();
915-
let mut cmd = Command::new(compiler);
915+
let mut cmd = BootstrapCommand::new(compiler);
916916

917917
cmd.arg("-o")
918918
.arg(&executable)
919919
.arg(builder.src.join("src/tools/libcxx-version/main.cpp"));
920920

921-
builder.run(BootstrapCommand::from(&mut cmd));
921+
builder.run(cmd);
922922

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

src/bootstrap/src/core/build_steps/vendor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
2-
use std::path::{Path, PathBuf};
32
use crate::utils::exec::BootstrapCommand;
3+
use std::path::{Path, PathBuf};
44

55
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
66
pub(crate) struct Vendor {

src/bootstrap/src/lib.rs

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

581581
// 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)