Skip to content

Commit fc28283

Browse files
authored
Merge pull request #3842 from nathaniel-bennett/rustc-wrapper-fix
Add RUSTC_WRAPPER support to build script
2 parents 6eddffb + 8dba4a0 commit fc28283

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,16 @@ fn rustc_minor_nightly() -> (u32, bool) {
120120
};
121121
}
122122

123-
let rustc = otry!(env::var_os("RUSTC"));
124-
let output = Command::new(rustc)
123+
let rustc = env::var_os("RUSTC").expect("Failed to get rustc version: missing RUSTC env");
124+
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER").filter(|w| !w.is_empty()) {
125+
let mut cmd = Command::new(wrapper);
126+
cmd.arg(rustc);
127+
cmd
128+
} else {
129+
Command::new(rustc)
130+
};
131+
132+
let output = cmd
125133
.arg("--version")
126134
.output()
127135
.ok()

0 commit comments

Comments
 (0)