about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorJakub Beránek <jakub.beranek@vsb.cz>2024-06-20 11:40:15 +0200
committerJakub Beránek <jakub.beranek@vsb.cz>2024-06-20 11:40:15 +0200
commit949e667d3fc97770134aaa5ea23be4972fde91ff (patch)
tree0182369e7bc652559894ec60bc514af118ac6556 /src/bootstrap
parenta12f541a18087550d080225835066cd1ddd60ccf (diff)
downloadrust-949e667d3fc97770134aaa5ea23be4972fde91ff.tar.gz
rust-949e667d3fc97770134aaa5ea23be4972fde91ff.zip
Remove `run_quiet`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs5
-rw-r--r--src/bootstrap/src/lib.rs15
-rw-r--r--src/bootstrap/src/utils/exec.rs2
3 files changed, 8 insertions, 14 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 445096e9786..834257a6e21 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -26,7 +26,7 @@ use crate::core::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
 use crate::core::config::flags::get_completion;
 use crate::core::config::flags::Subcommand;
 use crate::core::config::TargetSelection;
-use crate::utils::exec::BootstrapCommand;
+use crate::utils::exec::{BootstrapCommand, OutputMode};
 use crate::utils::helpers::{
     self, add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var,
     linker_args, linker_flags, output, t, target_supports_cranelift_backend, up_to_date,
@@ -2312,7 +2312,8 @@ impl Step for ErrorIndex {
         let guard =
             builder.msg(Kind::Test, compiler.stage, "error-index", compiler.host, compiler.host);
         let _time = helpers::timeit(builder);
-        builder.run_quiet(&mut tool);
+        builder
+            .run_tracked(BootstrapCommand::from(&mut tool).output_mode(OutputMode::PrintOnFailure));
         drop(guard);
         // The tests themselves need to link to std, so make sure it is
         // available.
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index b53f054c187..5b2913b1a83 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -958,7 +958,7 @@ impl Build {
         })
     }
 
-    fn run_tracked(&self, command: BootstrapCommand) -> CommandOutput {
+    fn run_tracked(&self, command: BootstrapCommand<'_>) -> CommandOutput {
         if self.config.dry_run() {
             return CommandOutput::default();
         }
@@ -970,7 +970,7 @@ impl Build {
                 command.command.status().map(|status| status.into()),
                 matches!(mode, OutputMode::PrintAll),
             ),
-            OutputMode::SuppressOnSuccess => (command.command.output().map(|o| o.into()), true),
+            OutputMode::PrintOnFailure => (command.command.output().map(|o| o.into()), true),
         };
 
         let output = match output {
@@ -1038,18 +1038,11 @@ impl Build {
     }
 
     /// Runs a command, printing out nice contextual information if it fails.
-    fn run_quiet(&self, cmd: &mut Command) {
-        self.run_cmd(
-            BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::SuppressOnSuccess),
-        );
-    }
-
-    /// Runs a command, printing out nice contextual information if it fails.
     /// Exits if the command failed to execute at all, otherwise returns its
     /// `status.success()`.
     fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
         self.run_cmd(
-            BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::SuppressOnSuccess),
+            BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::PrintOnFailure),
         )
     }
 
@@ -1071,7 +1064,7 @@ impl Build {
                 }),
                 matches!(mode, OutputMode::PrintAll),
             ),
-            OutputMode::SuppressOnSuccess => (command.command.output(), true),
+            OutputMode::PrintOnFailure => (command.command.output(), true),
         };
 
         let output = match output {
diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs
index e7dedfa99f2..21013345f09 100644
--- a/src/bootstrap/src/utils/exec.rs
+++ b/src/bootstrap/src/utils/exec.rs
@@ -20,7 +20,7 @@ pub enum OutputMode {
     /// Print the output (by inheriting stdout/stderr).
     PrintOutput,
     /// Suppress the output if the command succeeds, otherwise print the output.
-    SuppressOnSuccess,
+    PrintOnFailure,
 }
 
 /// Wrapper around `std::process::Command`.