Skip to content

Commit 7afa449

Browse files
committed
Auto merge of #5985 - dwijnand:fix-rustc-wrapper-unset, r=alexcrichton
Don't use an empty RUSTC_WRAPPER Fixes #5588
2 parents b15ee25 + 9b67b27 commit 7afa449

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/cargo/util/rustc.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ impl Rustc {
6666

6767
/// Get a process builder set up to use the found rustc version, with a wrapper if Some
6868
pub fn process(&self) -> ProcessBuilder {
69-
if let Some(ref wrapper) = self.wrapper {
70-
let mut cmd = util::process(wrapper);
71-
cmd.arg(&self.path);
72-
cmd
73-
} else {
74-
self.process_no_wrapper()
69+
match self.wrapper {
70+
Some(ref wrapper) if !wrapper.as_os_str().is_empty() => {
71+
let mut cmd = util::process(wrapper);
72+
cmd.arg(&self.path);
73+
cmd
74+
}
75+
_ => self.process_no_wrapper()
7576
}
7677
}
7778

tests/testsuite/check.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,3 +684,9 @@ fn proc_macro() {
684684
).build();
685685
p.cargo("check -v").env("RUST_LOG", "cargo=trace").run();
686686
}
687+
688+
#[test]
689+
fn does_not_use_empty_rustc_wrapper() {
690+
let p = project().file("src/lib.rs", "").build();
691+
p.cargo("check").env("RUSTC_WRAPPER", "").run();
692+
}

0 commit comments

Comments
 (0)