Skip to content

Commit

Permalink
Only use RUSTC_WRAPPER when non empty (#565)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Ingram <mark.ingram@anaplan.com>
  • Loading branch information
2 people authored and sunfishcode committed Oct 12, 2023
1 parent 1b0d416 commit 556ed8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ fn can_compile<T: AsRef<str>>(test: T) -> bool {
let rustc = var("RUSTC").unwrap();
let target = var("TARGET").unwrap();

let mut cmd = if let Ok(wrapper) = var("RUSTC_WRAPPER") {
let wrapper = var("RUSTC_WRAPPER")
.ok()
.and_then(|w| if w.is_empty() { None } else { Some(w) });

let mut cmd = if let Some(wrapper) = wrapper {
let mut cmd = std::process::Command::new(wrapper);
// The wrapper's first argument is supposed to be the path to rustc.
cmd.arg(rustc);
Expand Down

0 comments on commit 556ed8a

Please sign in to comment.