Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable verbose bootstrap command failure logging by default #128874

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do not print verbose error when a bootstrap command fails without ver…
…bose mode
  • Loading branch information
Kobzol committed Aug 9, 2024
commit a380d5e8f68de64441274ca2e56dd3a08a60a121
16 changes: 12 additions & 4 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1058,20 +1058,28 @@ Executed at: {executed_at}"#,
CommandOutput::did_not_start(stdout, stderr)
}
};

let fail = |message: &str| {
if self.is_verbose() {
println!("{message}");
} else {
println!("Command has failed. Rerun with -v to see more details.");
}
exit!(1);
};

if !output.is_success() {
match command.failure_behavior {
BehaviorOnFailure::DelayFail => {
if self.fail_fast {
println!("{message}");
exit!(1);
fail(&message);
}

let mut failures = self.delayed_failures.borrow_mut();
failures.push(message);
}
BehaviorOnFailure::Exit => {
println!("{message}");
exit!(1);
fail(&message);
}
BehaviorOnFailure::Ignore => {
// If failures are allowed, either the error has been printed already