diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-08-15 18:13:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-15 18:13:32 -0400 |
| commit | 56e9a67d16f02a2a2889f91f88c98638982a42e3 (patch) | |
| tree | 769b03a44a144239a181554eab026f7a0e93f984 /src/bootstrap | |
| parent | 4fa90ef7996f891f7f1e126411e5d75afe64accf (diff) | |
| parent | 24f5cc41c80a5ca22d5e6871aa71d1367bc15bf8 (diff) | |
| download | rust-56e9a67d16f02a2a2889f91f88c98638982a42e3.tar.gz rust-56e9a67d16f02a2a2889f91f88c98638982a42e3.zip | |
Rollup merge of #145455 - Kobzol:bootstrap-copy-src-dirs-dry-run, r=jieyouxu
Do not copy files in `copy_src_dirs` in dry run This reduces the time to run the current 9 dist snapshot tests from ~24s to ~2s on my PC. r? `@jieyouxu`
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/dist.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 64c2cdd2ec7..414f4464d1e 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -916,6 +916,12 @@ fn copy_src_dirs( exclude_dirs: &[&str], dst_dir: &Path, ) { + // Iterating, filtering and copying a large number of directories can be quite slow. + // Avoid doing it in dry run (and thus also tests). + if builder.config.dry_run() { + return; + } + fn filter_fn(exclude_dirs: &[&str], dir: &str, path: &Path) -> bool { let spath = match path.to_str() { Some(path) => path, |
