Skip to content

Commit c0c6a24

Browse files
committed
Replace builder::try_run_quiet with run_quiet_delaying_failure
It was only used when a `builder` is available, and I want to encourage using the version that supports `--no-fail-fast`.
1 parent 78f51a4 commit c0c6a24

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

src/bootstrap/lib.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -972,12 +972,21 @@ impl Build {
972972
/// Runs a command, printing out nice contextual information if it fails.
973973
/// Exits if the command failed to execute at all, otherwise returns its
974974
/// `status.success()`.
975-
fn try_run_quiet(&self, cmd: &mut Command) -> bool {
975+
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
976976
if self.config.dry_run() {
977977
return true;
978978
}
979-
self.verbose(&format!("running: {:?}", cmd));
980-
try_run_suppressed(cmd)
979+
if !self.fail_fast {
980+
self.verbose(&format!("running: {:?}", cmd));
981+
if !try_run_suppressed(cmd) {
982+
let mut failures = self.delayed_failures.borrow_mut();
983+
failures.push(format!("{:?}", cmd));
984+
return false;
985+
}
986+
} else {
987+
self.run_quiet(cmd);
988+
}
989+
true
981990
}
982991

983992
/// Runs a command, printing out contextual info if it fails, and delaying errors until the build finishes.

src/bootstrap/test.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[
4848
// build for, so there is no entry for "aarch64-apple-darwin" here.
4949
];
5050

51-
fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool {
52-
if !builder.fail_fast {
53-
if !builder.try_run_quiet(cmd) {
54-
let mut failures = builder.delayed_failures.borrow_mut();
55-
failures.push(format!("{:?}", cmd));
56-
return false;
57-
}
58-
} else {
59-
builder.run_quiet(cmd);
60-
}
61-
true
62-
}
63-
6451
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6552
pub struct CrateBootstrap {
6653
path: Interned<PathBuf>,
@@ -2134,7 +2121,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
21342121
if builder.config.verbose_tests {
21352122
builder.run_delaying_failure(&mut cmd)
21362123
} else {
2137-
try_run_quiet(builder, &mut cmd)
2124+
builder.run_quiet_delaying_failure(&mut cmd)
21382125
}
21392126
}
21402127

0 commit comments

Comments
 (0)