Skip to content

Commit 4afb1d5

Browse files
committed
fix printing cargo args on --dry-run
1 parent 63e0142 commit 4afb1d5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -1803,10 +1803,6 @@ pub fn run_cargo(
18031803
is_check: bool,
18041804
rlib_only_metadata: bool,
18051805
) -> Vec<PathBuf> {
1806-
if builder.config.dry_run() {
1807-
return Vec::new();
1808-
}
1809-
18101806
// `target_root_dir` looks like $dir/$target/release
18111807
let target_root_dir = stamp.parent().unwrap();
18121808
// `target_deps_dir` looks like $dir/$target/release/deps
@@ -1913,6 +1909,10 @@ pub fn run_cargo(
19131909
crate::exit!(1);
19141910
}
19151911

1912+
if builder.config.dry_run() {
1913+
return Vec::new();
1914+
}
1915+
19161916
// Ok now we need to actually find all the files listed in `toplevel`. We've
19171917
// got a list of prefix/extensions and we basically just need to find the
19181918
// most recent file in the `deps` folder corresponding to each one.
@@ -1968,9 +1968,6 @@ pub fn stream_cargo(
19681968
cb: &mut dyn FnMut(CargoMessage<'_>),
19691969
) -> bool {
19701970
let mut cargo = Command::from(cargo);
1971-
if builder.config.dry_run() {
1972-
return true;
1973-
}
19741971
// Instruct Cargo to give us json messages on stdout, critically leaving
19751972
// stderr as piped so we can get those pretty colors.
19761973
let mut message_format = if builder.config.json_output {
@@ -1989,6 +1986,11 @@ pub fn stream_cargo(
19891986
}
19901987

19911988
builder.verbose(&format!("running: {cargo:?}"));
1989+
1990+
if builder.config.dry_run() {
1991+
return true;
1992+
}
1993+
19921994
let mut child = match cargo.spawn() {
19931995
Ok(child) => child,
19941996
Err(e) => panic!("failed to execute command: {cargo:?}\nerror: {e}"),

0 commit comments

Comments
 (0)