Skip to content

Make rustc shim's verbose output include crate_name being compiled. #82782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,21 +138,28 @@ fn main() {
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}

let is_test = args.iter().any(|a| a == "--test");
if verbose > 1 {
let rust_env_vars =
env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO"));
let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" };
let prefix = match crate_name {
Some(crate_name) => format!("{} {}", prefix, crate_name),
None => prefix.to_string(),
};
for (i, (k, v)) in rust_env_vars.enumerate() {
eprintln!("rustc env[{}]: {:?}={:?}", i, k, v);
eprintln!("{} env[{}]: {:?}={:?}", prefix, i, k, v);
}
eprintln!("rustc working directory: {}", env::current_dir().unwrap().display());
eprintln!("{} working directory: {}", prefix, env::current_dir().unwrap().display());
eprintln!(
"rustc command: {:?}={:?} {:?}",
"{} command: {:?}={:?} {:?}",
prefix,
bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap(),
cmd,
);
eprintln!("sysroot: {:?}", sysroot);
eprintln!("libdir: {:?}", libdir);
eprintln!("{} sysroot: {:?}", prefix, sysroot);
eprintln!("{} libdir: {:?}", prefix, libdir);
}

let start = Instant::now();
Expand All @@ -166,7 +173,6 @@ fn main() {
{
if let Some(crate_name) = crate_name {
let dur = start.elapsed();
let is_test = args.iter().any(|a| a == "--test");
// If the user requested resource usage data, then
// include that in addition to the timing output.
let rusage_data =
Expand Down