Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 02e5f38

Browse files
committed
Add debug tracing for failed commands
1 parent d8c1393 commit 02e5f38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_system/utils.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ pub(crate) fn try_hard_link(src: impl AsRef<Path>, dst: impl AsRef<Path>) {
197197

198198
#[track_caller]
199199
pub(crate) fn spawn_and_wait(mut cmd: Command) {
200-
if !cmd.spawn().unwrap().wait().unwrap().success() {
200+
let status = cmd.spawn().unwrap().wait().unwrap();
201+
if !status.success() {
202+
eprintln!("{cmd:?} exited with status {:?}", status);
201203
process::exit(1);
202204
}
203205
}
@@ -233,6 +235,7 @@ pub(crate) fn spawn_and_wait_with_input(mut cmd: Command, input: String) -> Stri
233235

234236
let output = child.wait_with_output().expect("Failed to read stdout");
235237
if !output.status.success() {
238+
eprintln!("{cmd:?} exited with status {:?}", output.status);
236239
process::exit(1);
237240
}
238241

0 commit comments

Comments
 (0)