Skip to content

Commit 949e667

Browse files
committed
Remove run_quiet
1 parent a12f541 commit 949e667

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::core::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
2626
use crate::core::config::flags::get_completion;
2727
use crate::core::config::flags::Subcommand;
2828
use crate::core::config::TargetSelection;
29-
use crate::utils::exec::BootstrapCommand;
29+
use crate::utils::exec::{BootstrapCommand, OutputMode};
3030
use crate::utils::helpers::{
3131
self, add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var,
3232
linker_args, linker_flags, output, t, target_supports_cranelift_backend, up_to_date,
@@ -2312,7 +2312,8 @@ impl Step for ErrorIndex {
23122312
let guard =
23132313
builder.msg(Kind::Test, compiler.stage, "error-index", compiler.host, compiler.host);
23142314
let _time = helpers::timeit(builder);
2315-
builder.run_quiet(&mut tool);
2315+
builder
2316+
.run_tracked(BootstrapCommand::from(&mut tool).output_mode(OutputMode::PrintOnFailure));
23162317
drop(guard);
23172318
// The tests themselves need to link to std, so make sure it is
23182319
// available.

src/bootstrap/src/lib.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl Build {
958958
})
959959
}
960960

961-
fn run_tracked(&self, command: BootstrapCommand) -> CommandOutput {
961+
fn run_tracked(&self, command: BootstrapCommand<'_>) -> CommandOutput {
962962
if self.config.dry_run() {
963963
return CommandOutput::default();
964964
}
@@ -970,7 +970,7 @@ impl Build {
970970
command.command.status().map(|status| status.into()),
971971
matches!(mode, OutputMode::PrintAll),
972972
),
973-
OutputMode::SuppressOnSuccess => (command.command.output().map(|o| o.into()), true),
973+
OutputMode::PrintOnFailure => (command.command.output().map(|o| o.into()), true),
974974
};
975975

976976
let output = match output {
@@ -1037,19 +1037,12 @@ impl Build {
10371037
))
10381038
}
10391039

1040-
/// Runs a command, printing out nice contextual information if it fails.
1041-
fn run_quiet(&self, cmd: &mut Command) {
1042-
self.run_cmd(
1043-
BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::SuppressOnSuccess),
1044-
);
1045-
}
1046-
10471040
/// Runs a command, printing out nice contextual information if it fails.
10481041
/// Exits if the command failed to execute at all, otherwise returns its
10491042
/// `status.success()`.
10501043
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
10511044
self.run_cmd(
1052-
BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::SuppressOnSuccess),
1045+
BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::PrintOnFailure),
10531046
)
10541047
}
10551048

@@ -1071,7 +1064,7 @@ impl Build {
10711064
}),
10721065
matches!(mode, OutputMode::PrintAll),
10731066
),
1074-
OutputMode::SuppressOnSuccess => (command.command.output(), true),
1067+
OutputMode::PrintOnFailure => (command.command.output(), true),
10751068
};
10761069

10771070
let output = match output {

src/bootstrap/src/utils/exec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub enum OutputMode {
2020
/// Print the output (by inheriting stdout/stderr).
2121
PrintOutput,
2222
/// Suppress the output if the command succeeds, otherwise print the output.
23-
SuppressOnSuccess,
23+
PrintOnFailure,
2424
}
2525

2626
/// Wrapper around `std::process::Command`.

0 commit comments

Comments
 (0)