Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 903d6a9

Browse files
committed
Remove run_cmd
1 parent 99f77a2 commit 903d6a9

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl Step for Clippy {
766766
let _guard = builder.msg_sysroot_tool(Kind::Test, compiler.stage, "clippy", host, host);
767767

768768
// Clippy reports errors if it blessed the outputs
769-
if builder.run_cmd(BootstrapCommand::from(&mut cargo).allow_failure()) {
769+
if builder.run_tracked(BootstrapCommand::from(&mut cargo).allow_failure()).is_success() {
770770
// The tests succeeded; nothing to do.
771771
return;
772772
}
@@ -3352,7 +3352,7 @@ impl Step for CodegenCranelift {
33523352
cargo.args(builder.config.test_args());
33533353

33543354
let mut cmd: Command = cargo.into();
3355-
builder.run_cmd(BootstrapCommand::from(&mut cmd).fail_fast());
3355+
builder.run_tracked(BootstrapCommand::from(&mut cmd));
33563356
}
33573357
}
33583358

@@ -3478,6 +3478,6 @@ impl Step for CodegenGCC {
34783478
cargo.args(builder.config.test_args());
34793479

34803480
let mut cmd: Command = cargo.into();
3481-
builder.run_cmd(BootstrapCommand::from(&mut cmd).fail_fast());
3481+
builder.run_tracked(BootstrapCommand::from(&mut cmd));
34823482
}
34833483
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::core::builder;
99
use crate::core::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step};
1010
use crate::core::config::TargetSelection;
1111
use crate::utils::channel::GitInfo;
12+
use crate::utils::exec::BootstrapCommand;
1213
use crate::utils::helpers::output;
1314
use crate::utils::helpers::{add_dylib_path, exe, t};
1415
use crate::Compiler;
@@ -917,7 +918,7 @@ impl Step for LibcxxVersionTool {
917918
.arg(&executable)
918919
.arg(builder.src.join("src/tools/libcxx-version/main.cpp"));
919920

920-
builder.run_cmd(&mut cmd);
921+
builder.run_tracked(BootstrapCommand::from(&mut cmd));
921922

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

src/bootstrap/src/lib.rs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -580,14 +580,12 @@ impl Build {
580580

581581
// Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error).
582582
// diff-index reports the modifications through the exit status
583-
let has_local_modifications = !self.run_cmd(
584-
BootstrapCommand::from(submodule_git().args(["diff-index", "--quiet", "HEAD"]))
585-
.allow_failure()
586-
.output_mode(match self.is_verbose() {
587-
true => OutputMode::All,
588-
false => OutputMode::OnlyOutput,
589-
}),
590-
);
583+
let has_local_modifications = self
584+
.run_tracked(
585+
BootstrapCommand::from(submodule_git().args(["diff-index", "--quiet", "HEAD"]))
586+
.allow_failure(),
587+
)
588+
.is_failure();
591589
if has_local_modifications {
592590
self.run(submodule_git().args(["stash", "push"]));
593591
}
@@ -1026,18 +1024,7 @@ impl Build {
10261024

10271025
/// Runs a command, printing out nice contextual information if it fails.
10281026
fn run(&self, cmd: &mut Command) {
1029-
self.run_cmd(BootstrapCommand::from(cmd).fail_fast().output_mode(
1030-
match self.is_verbose() {
1031-
true => OutputMode::All,
1032-
false => OutputMode::OnlyOutput,
1033-
},
1034-
));
1035-
}
1036-
1037-
/// A centralized function for running commands that do not return output.
1038-
pub(crate) fn run_cmd<'a, C: Into<BootstrapCommand<'a>>>(&self, cmd: C) -> bool {
1039-
let command = cmd.into();
1040-
self.run_tracked(command).is_success()
1027+
self.run_tracked(BootstrapCommand::from(cmd));
10411028
}
10421029

10431030
/// Check if verbosity is greater than the `level`

0 commit comments

Comments
 (0)