Skip to content

Commit 35404d0

Browse files
committed
collector: passthrough env vars
This commit modifies the collector to stop clearing the environment when invoking the fake rustc. This is helpful for users of Nix development shells where environment variables are required to inform tools of the location of C dependencies, and for setting RUSTFLAGS to collect data from the same build with different flags. However, this change can result in some environment variables affecting the data collection where that isn't intended. Signed-off-by: David Wood <[email protected]>
1 parent b1f6c4d commit 35404d0

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

collector/src/bin/rustc-perf-collector/execute.rs

-11
Original file line numberDiff line numberDiff line change
@@ -232,17 +232,6 @@ impl<'a> CargoProcess<'a> {
232232
cmd
233233
// Not all cargo invocations (e.g. `cargo clean`) need all of these
234234
// env vars set, but it doesn't hurt to have them.
235-
.env_clear()
236-
// SHELL is needed for some benchmarks' build scripts.
237-
.env("SHELL", env::var_os("SHELL").unwrap_or_default())
238-
// PATH is needed to find things like linkers used by rustc/Cargo.
239-
.env("PATH", env::var_os("PATH").unwrap_or_default())
240-
// HOME is needed for cargo to find its home directory.
241-
.env("HOME", env::var_os("HOME").unwrap_or_default())
242-
.env(
243-
"RUSTC_THREAD_COUNT",
244-
env::var_os("RUSTC_THREAD_COUNT").unwrap_or_default(),
245-
)
246235
.env("RUSTC", &*FAKE_RUSTC)
247236
.env("RUSTC_REAL", &self.compiler.rustc)
248237
.env(

0 commit comments

Comments
 (0)