File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 36
36
37
37
use std:: env;
38
38
use std:: ffi:: OsString ;
39
+ use std:: iter;
39
40
use std:: path:: Path ;
40
41
use std:: process:: { self , Command , Stdio } ;
41
42
use std:: str;
@@ -138,15 +139,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
138
139
let out_dir = cargo_env_var ( "OUT_DIR" ) ;
139
140
let probefile = Path :: new ( "build" ) . join ( "probe.rs" ) ;
140
141
141
- // Make sure to pick up Cargo rustc configuration.
142
- let mut cmd = if let Some ( wrapper ) = env :: var_os ( "RUSTC_WRAPPER" ) {
143
- let mut cmd = Command :: new ( wrapper) ;
144
- // The wrapper's first argument is supposed to be the path to rustc.
145
- cmd . arg ( rustc ) ;
146
- cmd
147
- } else {
148
- Command :: new ( rustc)
149
- } ;
142
+ let rustc_wrapper = env :: var_os ( "RUSTC_WRAPPER" ) . filter ( |wrapper| !wrapper . is_empty ( ) ) ;
143
+ let rustc_workspace_wrapper =
144
+ env :: var_os ( "RUSTC_WORKSPACE_WRAPPER" ) . filter ( | wrapper| !wrapper . is_empty ( ) ) ;
145
+ let mut rustc = rustc_wrapper
146
+ . into_iter ( )
147
+ . chain ( rustc_workspace_wrapper )
148
+ . chain ( iter :: once ( rustc ) ) ;
149
+ let mut cmd = Command :: new ( rustc. next ( ) . unwrap ( ) ) ;
150
+ cmd . args ( rustc ) ;
150
151
151
152
if !rustc_bootstrap {
152
153
cmd. env_remove ( "RUSTC_BOOTSTRAP" ) ;
You can’t perform that action at this time.
0 commit comments