Skip to content

Commit d2d93e0

Browse files
Only use RUSTC_WRAPPER when non empty (#565)
Co-authored-by: Mark Ingram <mark.ingram@anaplan.com>
1 parent 46bb1a3 commit d2d93e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ fn can_compile<T: AsRef<str>>(test: T) -> bool {
240240
let rustc = var("RUSTC").unwrap();
241241
let target = var("TARGET").unwrap();
242242

243-
let mut cmd = if let Ok(wrapper) = var("RUSTC_WRAPPER") {
243+
let wrapper = var("RUSTC_WRAPPER")
244+
.ok()
245+
.and_then(|w| if w.is_empty() { None } else { Some(w) });
246+
247+
let mut cmd = if let Some(wrapper) = wrapper {
244248
let mut cmd = std::process::Command::new(wrapper);
245249
// The wrapper's first argument is supposed to be the path to rustc.
246250
cmd.arg(rustc);

0 commit comments

Comments
 (0)