Avoid more instances of unused command execution in dry run
This commit is contained in:
parent
72c354094d
commit
0cce0bb204
2 changed files with 7 additions and 15 deletions
|
@ -2068,11 +2068,7 @@ fn maybe_install_llvm(
|
|||
let mut cmd = command(llvm_config);
|
||||
cmd.arg("--libfiles");
|
||||
builder.verbose(|| println!("running {cmd:?}"));
|
||||
let files = if builder.config.dry_run() {
|
||||
"".into()
|
||||
} else {
|
||||
cmd.capture_stdout().run(builder).stdout()
|
||||
};
|
||||
let files = cmd.capture_stdout().run(builder).stdout();
|
||||
let build_llvm_out = &builder.llvm_out(builder.config.build);
|
||||
let target_llvm_out = &builder.llvm_out(target);
|
||||
for file in files.trim_end().split(' ') {
|
||||
|
|
|
@ -471,16 +471,12 @@ impl Miri {
|
|||
// We re-use the `cargo` from above.
|
||||
cargo.arg("--print-sysroot");
|
||||
|
||||
if builder.config.dry_run() {
|
||||
String::new()
|
||||
} else {
|
||||
builder.verbose(|| println!("running: {cargo:?}"));
|
||||
let stdout = cargo.capture_stdout().run(builder).stdout();
|
||||
// Output is "<sysroot>\n".
|
||||
let sysroot = stdout.trim_end();
|
||||
builder.verbose(|| println!("`cargo miri setup --print-sysroot` said: {sysroot:?}"));
|
||||
sysroot.to_owned()
|
||||
}
|
||||
builder.verbose(|| println!("running: {cargo:?}"));
|
||||
let stdout = cargo.capture_stdout().run(builder).stdout();
|
||||
// Output is "<sysroot>\n".
|
||||
let sysroot = stdout.trim_end();
|
||||
builder.verbose(|| println!("`cargo miri setup --print-sysroot` said: {sysroot:?}"));
|
||||
sysroot.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue