3416: Clean xtask partial artifacts in `xtask pre-cache` r=matklad a=CAD97

Confirmed that these aren't getting deleted locally.

This won't actually change what's cached until the cache key changes.

Co-authored-by: Christopher Durham <cad97@cad97.com>
This commit is contained in:
bors[bot] 2020-03-03 11:09:36 +00:00 committed by GitHub
commit b358fe19d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -87,7 +87,7 @@ jobs:
- name: Prepare cache 2
if: matrix.os == 'windows-latest'
run: Remove-Item ./target/debug/xtask.exe
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
typescript:
name: TypeScript

View file

@ -139,12 +139,15 @@ pub fn run_pre_cache() -> Result<()> {
}
fs2::remove_file("./target/.rustc_info.json")?;
let to_delete = ["ra_", "heavy_test"];
let to_delete = ["ra_", "heavy_test", "xtask"];
for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() {
for entry in Path::new(dir).read_dir()? {
let entry = entry?;
if to_delete.iter().any(|&it| entry.path().display().to_string().contains(it)) {
rm_rf(&entry.path())?
// Can't delete yourself on windows :-(
if !entry.path().ends_with("xtask.exe") {
rm_rf(&entry.path())?
}
}
}
}