File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 3636
3737use std:: env;
3838use std:: ffi:: OsString ;
39+ use std:: iter;
3940use std:: path:: Path ;
4041use std:: process:: { self , Command , Stdio } ;
4142use std:: str;
@@ -138,15 +139,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
138139 let out_dir = cargo_env_var ( "OUT_DIR" ) ;
139140 let probefile = Path :: new ( "build" ) . join ( "probe.rs" ) ;
140141
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 ) ;
150151
151152 if !rustc_bootstrap {
152153 cmd. env_remove ( "RUSTC_BOOTSTRAP" ) ;
You can’t perform that action at this time.
0 commit comments