Skip to content

Commit 5035cb2

Browse files
committed
remove env::var from util::rustc::rustc_fingerprint
1 parent f73a638 commit 5035cb2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/cargo/util/config/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ impl Config {
426426
} else {
427427
None
428428
},
429+
self,
429430
)
430431
}
431432

src/cargo/util/rustc.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use log::{debug, info, warn};
1010
use serde::{Deserialize, Serialize};
1111

1212
use crate::util::interning::InternedString;
13-
use crate::util::{profile, CargoResult, StableHasher};
13+
use crate::util::{profile, CargoResult, Config, StableHasher};
1414

1515
/// Information on the `rustc` executable
1616
#[derive(Debug)]
@@ -43,6 +43,7 @@ impl Rustc {
4343
workspace_wrapper: Option<PathBuf>,
4444
rustup_rustc: &Path,
4545
cache_location: Option<PathBuf>,
46+
config: &Config,
4647
) -> CargoResult<Rustc> {
4748
let _p = profile::start("Rustc::new");
4849

@@ -52,6 +53,7 @@ impl Rustc {
5253
&path,
5354
rustup_rustc,
5455
cache_location,
56+
config,
5557
);
5658

5759
let mut cmd = ProcessBuilder::new(&path);
@@ -173,10 +175,11 @@ impl Cache {
173175
rustc: &Path,
174176
rustup_rustc: &Path,
175177
cache_location: Option<PathBuf>,
178+
config: &Config,
176179
) -> Cache {
177180
match (
178181
cache_location,
179-
rustc_fingerprint(wrapper, workspace_wrapper, rustc, rustup_rustc),
182+
rustc_fingerprint(wrapper, workspace_wrapper, rustc, rustup_rustc, config),
180183
) {
181184
(Some(cache_location), Ok(rustc_fingerprint)) => {
182185
let empty = CacheData {
@@ -296,6 +299,7 @@ fn rustc_fingerprint(
296299
workspace_wrapper: Option<&Path>,
297300
rustc: &Path,
298301
rustup_rustc: &Path,
302+
config: &Config,
299303
) -> CargoResult<u64> {
300304
let mut hasher = StableHasher::new();
301305

@@ -329,8 +333,8 @@ fn rustc_fingerprint(
329333
let maybe_rustup = rustup_rustc == rustc;
330334
match (
331335
maybe_rustup,
332-
env::var("RUSTUP_HOME"),
333-
env::var("RUSTUP_TOOLCHAIN"),
336+
config.get_env("RUSTUP_HOME"),
337+
config.get_env("RUSTUP_TOOLCHAIN"),
334338
) {
335339
(_, Ok(rustup_home), Ok(rustup_toolchain)) => {
336340
debug!("adding rustup info to rustc fingerprint");

0 commit comments

Comments
 (0)