File tree 2 files changed +6
-11
lines changed
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 16
16
//! never get replaced.
17
17
18
18
use std:: env;
19
- use std:: path:: { Path , PathBuf } ;
19
+ use std:: path:: PathBuf ;
20
20
use std:: process:: { Child , Command } ;
21
21
use std:: time:: Instant ;
22
22
@@ -75,17 +75,12 @@ fn main() {
75
75
args. drain ( ..2 ) ;
76
76
rustc_real
77
77
} else {
78
+ // The first param is the clippy-driver we should call.
78
79
args. remove ( 0 )
79
80
}
80
81
} else {
81
- // Cargo doesn't respect RUSTC_WRAPPER for version information >:(
82
- // don't remove the first arg if we're being run as RUSTC instead of RUSTC_WRAPPER.
83
- // Cargo also sometimes doesn't pass the `.exe` suffix on Windows - add it manually.
84
- let current_exe = env:: current_exe ( ) . expect ( "couldn't get path to rustc shim" ) ;
85
- let arg0 = exe ( args[ 0 ] . to_str ( ) . expect ( "only utf8 paths are supported" ) , & host) ;
86
- if Path :: new ( & arg0) == current_exe {
87
- args. remove ( 0 ) ;
88
- }
82
+ // We are RUSTC_WRAPPER; remove the dummy rustc invocation we wrap.
83
+ args. remove ( 0 ) ;
89
84
rustc_real
90
85
} ;
91
86
Original file line number Diff line number Diff line change @@ -1754,8 +1754,8 @@ impl<'a> Builder<'a> {
1754
1754
// NOTE: we intentionally use RUSTC_WRAPPER so that we can support clippy - RUSTC is not
1755
1755
// respected by clippy-driver; RUSTC_WRAPPER happens earlier, before clippy runs.
1756
1756
cargo. env ( "RUSTC_WRAPPER" , self . bootstrap_out . join ( "rustc" ) ) ;
1757
- // NOTE: we also need to set RUSTC so cargo can run `rustc -vV`; apparently that ignores RUSTC_WRAPPER >:(
1758
- cargo. env ( "RUSTC" , self . bootstrap_out . join ( " rustc" ) ) ;
1757
+ // Set RUSTC to a non-existent path: it should never be called, since we always invoke the wrapper!
1758
+ cargo. env ( "RUSTC" , "/path/to/nowhere/all- rustc-calls-should-go-through-the-wrapper" ) ;
1759
1759
1760
1760
// Someone might have set some previous rustc wrapper (e.g.
1761
1761
// sccache) before bootstrap overrode it. Respect that variable.
You can’t perform that action at this time.
0 commit comments