Skip to content

Commit

Permalink
Auto merge of #124296 - cuviper:dist-cargo-tests, r=onur-ozkan
Browse files Browse the repository at this point in the history
bootstrap: keep all cargo test files in dist rustc-src

Cargo tests use some files that we would otherwise exclude, especially
the `cargo init` tests that are meant to deal with pre-existing `.git`
and `.hg` repos and their ignore files. Keeping these in our dist
tarball doesn't take much space, and allows distro builds to run these
tests successfully.
  • Loading branch information
bors committed Apr 26, 2024
2 parents 4d570ee + 899e3ae commit aa6a8ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,12 @@ fn copy_src_dirs(
return false;
}

// Cargo tests use some files like `.gitignore` that we would otherwise exclude.
const CARGO_TESTS: &[&str] = &["tools/cargo/tests", "tools\\cargo\\tests"];
if CARGO_TESTS.iter().any(|path| spath.contains(path)) {
return true;
}

let full_path = Path::new(dir).join(path);
if exclude_dirs.iter().any(|excl| full_path == Path::new(excl)) {
return false;
Expand Down

0 comments on commit aa6a8ee

Please sign in to comment.