@@ -10,7 +10,7 @@ use log::{debug, info, warn};
10
10
use serde:: { Deserialize , Serialize } ;
11
11
12
12
use crate :: util:: interning:: InternedString ;
13
- use crate :: util:: { profile, CargoResult , StableHasher } ;
13
+ use crate :: util:: { profile, CargoResult , Config , StableHasher } ;
14
14
15
15
/// Information on the `rustc` executable
16
16
#[ derive( Debug ) ]
@@ -43,6 +43,7 @@ impl Rustc {
43
43
workspace_wrapper : Option < PathBuf > ,
44
44
rustup_rustc : & Path ,
45
45
cache_location : Option < PathBuf > ,
46
+ config : & Config ,
46
47
) -> CargoResult < Rustc > {
47
48
let _p = profile:: start ( "Rustc::new" ) ;
48
49
@@ -52,6 +53,7 @@ impl Rustc {
52
53
& path,
53
54
rustup_rustc,
54
55
cache_location,
56
+ config,
55
57
) ;
56
58
57
59
let mut cmd = ProcessBuilder :: new ( & path) ;
@@ -173,10 +175,11 @@ impl Cache {
173
175
rustc : & Path ,
174
176
rustup_rustc : & Path ,
175
177
cache_location : Option < PathBuf > ,
178
+ config : & Config ,
176
179
) -> Cache {
177
180
match (
178
181
cache_location,
179
- rustc_fingerprint ( wrapper, workspace_wrapper, rustc, rustup_rustc) ,
182
+ rustc_fingerprint ( wrapper, workspace_wrapper, rustc, rustup_rustc, config ) ,
180
183
) {
181
184
( Some ( cache_location) , Ok ( rustc_fingerprint) ) => {
182
185
let empty = CacheData {
@@ -296,6 +299,7 @@ fn rustc_fingerprint(
296
299
workspace_wrapper : Option < & Path > ,
297
300
rustc : & Path ,
298
301
rustup_rustc : & Path ,
302
+ config : & Config ,
299
303
) -> CargoResult < u64 > {
300
304
let mut hasher = StableHasher :: new ( ) ;
301
305
@@ -329,8 +333,8 @@ fn rustc_fingerprint(
329
333
let maybe_rustup = rustup_rustc == rustc;
330
334
match (
331
335
maybe_rustup,
332
- env :: var ( "RUSTUP_HOME" ) ,
333
- env :: var ( "RUSTUP_TOOLCHAIN" ) ,
336
+ config . get_env ( "RUSTUP_HOME" ) ,
337
+ config . get_env ( "RUSTUP_TOOLCHAIN" ) ,
334
338
) {
335
339
( _, Ok ( rustup_home) , Ok ( rustup_toolchain) ) => {
336
340
debug ! ( "adding rustup info to rustc fingerprint" ) ;
0 commit comments