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 1
1
use std:: env;
2
2
use std:: ffi:: OsString ;
3
+ use std:: iter;
3
4
use std:: path:: Path ;
4
5
use std:: process:: { self , Command , Stdio } ;
5
6
use std:: str;
@@ -103,15 +104,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
103
104
let out_dir = cargo_env_var ( "OUT_DIR" ) ;
104
105
let probefile = Path :: new ( "build" ) . join ( "probe.rs" ) ;
105
106
106
- // Make sure to pick up Cargo rustc configuration.
107
- let mut cmd = if let Some ( wrapper ) = env :: var_os ( "RUSTC_WRAPPER" ) {
108
- let mut cmd = Command :: new ( wrapper) ;
109
- // The wrapper's first argument is supposed to be the path to rustc.
110
- cmd . arg ( rustc ) ;
111
- cmd
112
- } else {
113
- Command :: new ( rustc)
114
- } ;
107
+ let rustc_wrapper = env :: var_os ( "RUSTC_WRAPPER" ) . filter ( |wrapper| !wrapper . is_empty ( ) ) ;
108
+ let rustc_workspace_wrapper =
109
+ env :: var_os ( "RUSTC_WORKSPACE_WRAPPER" ) . filter ( | wrapper| !wrapper . is_empty ( ) ) ;
110
+ let mut rustc = rustc_wrapper
111
+ . into_iter ( )
112
+ . chain ( rustc_workspace_wrapper )
113
+ . chain ( iter :: once ( rustc ) ) ;
114
+ let mut cmd = Command :: new ( rustc. next ( ) . unwrap ( ) ) ;
115
+ cmd . args ( rustc ) ;
115
116
116
117
if !rustc_bootstrap {
117
118
cmd. env_remove ( "RUSTC_BOOTSTRAP" ) ;
You can’t perform that action at this time.
0 commit comments