From 51f07cbd26460717857c28059239db2d458ec146 Mon Sep 17 00:00:00 2001 From: Jane Losare-Lusby Date: Fri, 22 Jul 2022 17:39:35 -0700 Subject: [PATCH 1/3] Teach rustc-fake to tell the truth about subprocess exit statuses --- collector/src/rustc-fake.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collector/src/rustc-fake.rs b/collector/src/rustc-fake.rs index b92d6c8a1..fb0d1b6a2 100644 --- a/collector/src/rustc-fake.rs +++ b/collector/src/rustc-fake.rs @@ -467,8 +467,10 @@ fn process_self_profile_output(prof_out_dir: PathBuf, args: &[OsString]) { #[cfg(windows)] fn exec(cmd: &mut Command) { let cmd_d = format!("{:?}", cmd); - if let Err(e) = cmd.status() { - panic!("failed to execute `{}`: {}", cmd_d, e); + match cmd.status() { + Ok(status) if !status.success() => std::process::exit(1), + Ok(_) => {}, + Err(e) => panic!("failed to execute `{}`: {}", cmd_d, e), } } From e38c0a6802de4522f21c43712cced08c4fc2378c Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 22 Jul 2022 21:57:10 -0400 Subject: [PATCH 2/3] Update collector/src/rustc-fake.rs Co-authored-by: Eduard-Mihai Burtescu --- collector/src/rustc-fake.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/collector/src/rustc-fake.rs b/collector/src/rustc-fake.rs index fb0d1b6a2..0cab7170e 100644 --- a/collector/src/rustc-fake.rs +++ b/collector/src/rustc-fake.rs @@ -468,8 +468,7 @@ fn process_self_profile_output(prof_out_dir: PathBuf, args: &[OsString]) { fn exec(cmd: &mut Command) { let cmd_d = format!("{:?}", cmd); match cmd.status() { - Ok(status) if !status.success() => std::process::exit(1), - Ok(_) => {}, + Ok(status) => std::process::exit(status.code().unwrap_or(1)), Err(e) => panic!("failed to execute `{}`: {}", cmd_d, e), } } From ea3571f179e778ed2f6ea9b6877f12858c0f4f5e Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 22 Jul 2022 22:55:00 -0400 Subject: [PATCH 3/3] Update collector/src/rustc-fake.rs Co-authored-by: Jane Losare-Lusby --- collector/src/rustc-fake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/src/rustc-fake.rs b/collector/src/rustc-fake.rs index 0cab7170e..5c89d174f 100644 --- a/collector/src/rustc-fake.rs +++ b/collector/src/rustc-fake.rs @@ -469,7 +469,7 @@ fn exec(cmd: &mut Command) { let cmd_d = format!("{:?}", cmd); match cmd.status() { Ok(status) => std::process::exit(status.code().unwrap_or(1)), - Err(e) => panic!("failed to execute `{}`: {}", cmd_d, e), + Err(e) => panic!("failed to spawn `{}`: {}", cmd_d, e), } }