Don't use an empty RUSTC_WRAPPER

This commit is contained in:
Dale Wijnand 2018-09-06 00:26:29 +01:00
parent b15ee255e5
commit 9b67b272ba
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
2 changed files with 13 additions and 6 deletions

View File

@ -66,12 +66,13 @@ impl Rustc {
/// Get a process builder set up to use the found rustc version, with a wrapper if Some /// Get a process builder set up to use the found rustc version, with a wrapper if Some
pub fn process(&self) -> ProcessBuilder { pub fn process(&self) -> ProcessBuilder {
if let Some(ref wrapper) = self.wrapper { match self.wrapper {
Some(ref wrapper) if !wrapper.as_os_str().is_empty() => {
let mut cmd = util::process(wrapper); let mut cmd = util::process(wrapper);
cmd.arg(&self.path); cmd.arg(&self.path);
cmd cmd
} else { }
self.process_no_wrapper() _ => self.process_no_wrapper()
} }
} }

View File

@ -684,3 +684,9 @@ fn proc_macro() {
).build(); ).build();
p.cargo("check -v").env("RUST_LOG", "cargo=trace").run(); p.cargo("check -v").env("RUST_LOG", "cargo=trace").run();
} }
#[test]
fn does_not_use_empty_rustc_wrapper() {
let p = project().file("src/lib.rs", "").build();
p.cargo("check").env("RUSTC_WRAPPER", "").run();
}