Skip to content

Commit 37e0613

Browse files
RalfJungstepancheg
authored andcommitted
apply RUSTC_WRAPPER when querying rustc version
1 parent 3ba69de commit 37e0613

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

protobuf/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ fn version_is_nightly(version: &str) -> bool {
1919

2020
fn cfg_rust_version() {
2121
let rustc = env::var("RUSTC").expect("RUSTC unset");
22+
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER").filter(|w| !w.is_empty()) {
23+
let mut cmd = process::Command::new(wrapper);
24+
cmd.arg(rustc);
25+
cmd
26+
} else {
27+
process::Command::new(rustc)
28+
};
2229

23-
let mut child = process::Command::new(rustc)
30+
let mut child = cmd
2431
.args(&["--version"])
2532
.stdin(process::Stdio::null())
2633
.stdout(process::Stdio::piped())

0 commit comments

Comments
 (0)