Skip to content

Commit 24f5cc4

Browse files
committed
Do not copy files in copy_src_dirs in dry run
1 parent 8800ec1 commit 24f5cc4

File tree

1 file changed

+6
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,12 @@ fn copy_src_dirs(
916916
exclude_dirs: &[&str],
917917
dst_dir: &Path,
918918
) {
919+
// Iterating, filtering and copying a large number of directories can be quite slow.
920+
// Avoid doing it in dry run (and thus also tests).
921+
if builder.config.dry_run() {
922+
return;
923+
}
924+
919925
fn filter_fn(exclude_dirs: &[&str], dir: &str, path: &Path) -> bool {
920926
let spath = match path.to_str() {
921927
Some(path) => path,

0 commit comments

Comments
 (0)