diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-09-07 13:36:03 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-09-14 18:42:55 +0000 |
| commit | 02e5f387fad115d172ef09697faffd8a4b90b29f (patch) | |
| tree | 451ef4acee23655b523f121d461358b8049fd34f | |
| parent | d8c1393557eb7f893184af54b21ce29ee3d08432 (diff) | |
| download | rust-02e5f387fad115d172ef09697faffd8a4b90b29f.tar.gz rust-02e5f387fad115d172ef09697faffd8a4b90b29f.zip | |
Add debug tracing for failed commands
| -rw-r--r-- | build_system/utils.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/build_system/utils.rs b/build_system/utils.rs index 24624cdeab1..9f5e37db35e 100644 --- a/build_system/utils.rs +++ b/build_system/utils.rs @@ -197,7 +197,9 @@ pub(crate) fn try_hard_link(src: impl AsRef<Path>, dst: impl AsRef<Path>) { #[track_caller] pub(crate) fn spawn_and_wait(mut cmd: Command) { - if !cmd.spawn().unwrap().wait().unwrap().success() { + let status = cmd.spawn().unwrap().wait().unwrap(); + if !status.success() { + eprintln!("{cmd:?} exited with status {:?}", status); process::exit(1); } } @@ -233,6 +235,7 @@ pub(crate) fn spawn_and_wait_with_input(mut cmd: Command, input: String) -> Stri let output = child.wait_with_output().expect("Failed to read stdout"); if !output.status.success() { + eprintln!("{cmd:?} exited with status {:?}", output.status); process::exit(1); } |
