From 9fafffd50b50f0c9132dc1098382992b8457cdbb Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 22 Feb 2021 11:21:12 -0500 Subject: [PATCH] Print out env vars related to Rust on (sufficiently verbose) rustc invocations. Fix issue 38686. (update: placated tidy.) --- src/bootstrap/bin/rustc.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 3694bdbf67054..7cf4311b98578 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -139,6 +139,12 @@ fn main() { } if verbose > 1 { + let rust_env_vars = + env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO")); + for (i, (k, v)) in rust_env_vars.enumerate() { + eprintln!("rustc env[{}]: {:?}={:?}", i, k, v); + } + eprintln!("rustc working directory: {}", env::current_dir().unwrap().display()); eprintln!( "rustc command: {:?}={:?} {:?}", bootstrap::util::dylib_path_var(),