Auto merge of #124296 - cuviper:dist-cargo-tests, r=onur-ozkan

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.
This commit is contained in:
bors 2024-04-26 22:22:47 +00:00
commit aa6a8ee270

View File

@ -830,6 +830,12 @@ fn filter_fn(exclude_dirs: &[&str], dir: &str, path: &Path) -> bool {
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;