Print out env vars related to Rust on (sufficiently verbose) rustc invocations.

Fix issue 38686.

(update: placated tidy.)
This commit is contained in:
Felix S. Klock II 2021-02-22 11:21:12 -05:00
parent 15598a83db
commit 9fafffd50b
1 changed files with 6 additions and 0 deletions

View File

@ -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(),