Skip to content

Commit

Permalink
Auto merge of #3175 - RalfJung:sysroot-verbose, r=RalfJung
Browse files Browse the repository at this point in the history
cargo-miri: when verbose, print where the sysroot is being built

Fixes #3169
  • Loading branch information
bors committed Nov 18, 2023
2 parents 02baccc + f91209e commit 1d4e6e7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions cargo-miri/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use std::env;
use std::ffi::OsStr;
use std::fmt::Write;
use std::path::PathBuf;
use std::process::{self, Command};

Expand Down Expand Up @@ -140,12 +141,20 @@ pub fn setup(
// Do the build.
if print_sysroot {
// Be silent.
} else if only_setup {
// We want to be explicit.
eprintln!("Preparing a sysroot for Miri (target: {target})...");
} else {
// We want to be quiet, but still let the user know that something is happening.
eprint!("Preparing a sysroot for Miri (target: {target})... ");
let mut msg = String::new();
write!(msg, "Preparing a sysroot for Miri (target: {target})").unwrap();
if verbose > 0 {
write!(msg, " in {}", sysroot_dir.display()).unwrap();
}
write!(msg, "...").unwrap();
if only_setup {
// We want to be explicit.
eprintln!("{msg}");
} else {
// We want to be quiet, but still let the user know that something is happening.
eprint!("{msg} ");
}
}
SysrootBuilder::new(&sysroot_dir, target)
.build_mode(BuildMode::Check)
Expand Down

0 comments on commit 1d4e6e7

Please sign in to comment.