Skip to content

Commit 4ddc3ad

Browse files
authored
Merge pull request #4665 from RalfJung/run-verbose
./miri run: verbose by default, add flag to be quiet
2 parents ccdb1c0 + 384c05f commit 4ddc3ad

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/tools/miri/miri-script/src/commands.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ impl MiriEnv {
5757
.arg("--")
5858
.args(&["miri", "setup", "--print-sysroot"])
5959
.args(target_flag);
60-
cmd.set_quiet(quiet);
60+
if quiet {
61+
cmd = cmd.arg("--quiet");
62+
}
6163
let output = cmd.read()?;
6264
self.sh.set_var("MIRI_SYSROOT", &output);
6365
Ok(output.into())
@@ -112,8 +114,8 @@ impl Command {
112114
Command::Check { features, flags } => Self::check(features, flags),
113115
Command::Test { bless, target, coverage, features, flags } =>
114116
Self::test(bless, target, coverage, features, flags),
115-
Command::Run { dep, verbose, target, edition, features, flags } =>
116-
Self::run(dep, verbose, target, edition, features, flags),
117+
Command::Run { dep, quiet, target, edition, features, flags } =>
118+
Self::run(dep, quiet, target, edition, features, flags),
117119
Command::Doc { features, flags } => Self::doc(features, flags),
118120
Command::Fmt { flags } => Self::fmt(flags),
119121
Command::Clippy { features, flags } => Self::clippy(features, flags),
@@ -458,7 +460,7 @@ impl Command {
458460

459461
fn run(
460462
dep: bool,
461-
verbose: bool,
463+
quiet: bool,
462464
target: Option<String>,
463465
edition: Option<String>,
464466
features: Vec<String>,
@@ -468,7 +470,7 @@ impl Command {
468470

469471
// Preparation: get a sysroot, and get the miri binary.
470472
let miri_sysroot =
471-
e.build_miri_sysroot(/* quiet */ !verbose, target.as_deref(), &features)?;
473+
e.build_miri_sysroot(/* quiet */ quiet, target.as_deref(), &features)?;
472474
let miri_bin = e
473475
.build_get_binary(".", &features)
474476
.context("failed to get filename of miri executable")?;
@@ -492,7 +494,7 @@ impl Command {
492494
// Compute flags.
493495
let miri_flags = e.sh.var("MIRIFLAGS").unwrap_or_default();
494496
let miri_flags = flagsplit(&miri_flags);
495-
let quiet_flag = if verbose { None } else { Some("--quiet") };
497+
let quiet_flag = if quiet { Some("--quiet") } else { None };
496498

497499
// Run Miri.
498500
// The basic command that executes the Miri driver.
@@ -506,7 +508,7 @@ impl Command {
506508
} else {
507509
cmd!(e.sh, "{miri_bin}")
508510
};
509-
cmd.set_quiet(!verbose);
511+
cmd.set_quiet(quiet);
510512
// Add Miri flags
511513
let mut cmd = cmd.args(&miri_flags).args(&early_flags).args(&flags);
512514
// For `--dep` we also need to set the target in the env var.

src/tools/miri/miri-script/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ pub enum Command {
7878
/// Build the program with the dependencies declared in `tests/deps/Cargo.toml`.
7979
#[arg(long)]
8080
dep: bool,
81-
/// Show build progress.
81+
/// Hide build progress.
8282
#[arg(long, short)]
83-
verbose: bool,
83+
quiet: bool,
8484
/// The cross-interpretation target.
8585
#[arg(long)]
8686
target: Option<String>,

0 commit comments

Comments
 (0)