Skip to content
Merged
Changes from all commits
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
11 changes: 11 additions & 0 deletions src/bootstrap/src/utils/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! relevant to command execution in the bootstrap process. This includes settings such as
//! dry-run mode, verbosity level, and failure behavior.

use std::backtrace::{Backtrace, BacktraceStatus};
use std::collections::HashMap;
use std::ffi::{OsStr, OsString};
use std::fmt::{Debug, Formatter};
Expand Down Expand Up @@ -930,6 +931,16 @@ Executed at: {executed_at}"#,
if stderr.captures() {
writeln!(error_message, "\n--- STDERR vvv\n{}", output.stderr().trim()).unwrap();
}
let backtrace = if exec_ctx.verbosity > 1 {
Backtrace::force_capture()
} else if matches!(command.failure_behavior, BehaviorOnFailure::Ignore) {
Backtrace::disabled()
} else {
Backtrace::capture()
};
if matches!(backtrace.status(), BacktraceStatus::Captured) {
writeln!(error_message, "\n--- BACKTRACE vvv\n{backtrace}").unwrap();
}

match command.failure_behavior {
BehaviorOnFailure::DelayFail => {
Expand Down
Loading