rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.16k stars 318 forks source link

`cargo miri --quiet` prints `Preparing a sysroot [...]` #3530

Closed narpfel closed 2 months ago

narpfel commented 2 months ago

-q/--quiet usually suppresses all of cargo’s output:

$ cargo run
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/t`
Hello, world!
$ cargo run -q
Hello, world!

However, when using cargo miri, the Preparing a sysroot line is still printed:

$ cargo miri run -q
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... done
Hello, world!

I’ve run into this while comparing the output of a program to the output when running in miri to test if it behaves identically in both scenarios. Manually removing the line works as a workaround, but it would be nicer if cargo miri didn’t print it in the first place.

RalfJung commented 2 months ago

Yeah that's fair, we should probably suppress this when -q/--quiet is present. This should work similar to the existing logic for -v.