Skip to content

Commit 0cce0bb

Browse files
committed
Avoid more instances of unused command execution in dry run
1 parent 72c3540 commit 0cce0bb

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -2068,11 +2068,7 @@ fn maybe_install_llvm(
20682068
let mut cmd = command(llvm_config);
20692069
cmd.arg("--libfiles");
20702070
builder.verbose(|| println!("running {cmd:?}"));
2071-
let files = if builder.config.dry_run() {
2072-
"".into()
2073-
} else {
2074-
cmd.capture_stdout().run(builder).stdout()
2075-
};
2071+
let files = cmd.capture_stdout().run(builder).stdout();
20762072
let build_llvm_out = &builder.llvm_out(builder.config.build);
20772073
let target_llvm_out = &builder.llvm_out(target);
20782074
for file in files.trim_end().split(' ') {

src/bootstrap/src/core/build_steps/test.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -471,16 +471,12 @@ impl Miri {
471471
// We re-use the `cargo` from above.
472472
cargo.arg("--print-sysroot");
473473

474-
if builder.config.dry_run() {
475-
String::new()
476-
} else {
477-
builder.verbose(|| println!("running: {cargo:?}"));
478-
let stdout = cargo.capture_stdout().run(builder).stdout();
479-
// Output is "<sysroot>\n".
480-
let sysroot = stdout.trim_end();
481-
builder.verbose(|| println!("`cargo miri setup --print-sysroot` said: {sysroot:?}"));
482-
sysroot.to_owned()
483-
}
474+
builder.verbose(|| println!("running: {cargo:?}"));
475+
let stdout = cargo.capture_stdout().run(builder).stdout();
476+
// Output is "<sysroot>\n".
477+
let sysroot = stdout.trim_end();
478+
builder.verbose(|| println!("`cargo miri setup --print-sysroot` said: {sysroot:?}"));
479+
sysroot.to_owned()
484480
}
485481
}
486482

0 commit comments

Comments
 (0)