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`.
This commit is contained in:
parent
78f51a4be0
commit
c0c6a24f89
2 changed files with 13 additions and 17 deletions
|
@ -972,12 +972,21 @@ impl Build {
|
|||
/// 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 try_run_quiet(&self, cmd: &mut Command) -> bool {
|
||||
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
|
||||
if self.config.dry_run() {
|
||||
return true;
|
||||
}
|
||||
self.verbose(&format!("running: {:?}", cmd));
|
||||
try_run_suppressed(cmd)
|
||||
if !self.fail_fast {
|
||||
self.verbose(&format!("running: {:?}", cmd));
|
||||
if !try_run_suppressed(cmd) {
|
||||
let mut failures = self.delayed_failures.borrow_mut();
|
||||
failures.push(format!("{:?}", cmd));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
self.run_quiet(cmd);
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
/// Runs a command, printing out contextual info if it fails, and delaying errors until the build finishes.
|
||||
|
|
|
@ -48,19 +48,6 @@ const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[
|
|||
// build for, so there is no entry for "aarch64-apple-darwin" here.
|
||||
];
|
||||
|
||||
fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool {
|
||||
if !builder.fail_fast {
|
||||
if !builder.try_run_quiet(cmd) {
|
||||
let mut failures = builder.delayed_failures.borrow_mut();
|
||||
failures.push(format!("{:?}", cmd));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
builder.run_quiet(cmd);
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct CrateBootstrap {
|
||||
path: Interned<PathBuf>,
|
||||
|
@ -2134,7 +2121,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
|
|||
if builder.config.verbose_tests {
|
||||
builder.run_delaying_failure(&mut cmd)
|
||||
} else {
|
||||
try_run_quiet(builder, &mut cmd)
|
||||
builder.run_quiet_delaying_failure(&mut cmd)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue