]> git.lizzy.rs Git - rust.git/commitdiff
Clean xtask partial artifacts in `xtask pre-cache`
authorChristopher Durham <cad97@cad97.com>
Tue, 3 Mar 2020 04:30:14 +0000 (23:30 -0500)
committerCAD97 <cad97@cad97.com>
Tue, 3 Mar 2020 04:50:10 +0000 (23:50 -0500)
.github/workflows/ci.yaml
xtask/src/lib.rs

index 3f41d32f7bae1b983b499dfe5c27f19ab715da25..50c4265cf905999705bb57e68b0895ca0e6bb748 100644 (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
index 55cdee4916d33d01406336e34e639326a7b773dc..f48045d17e1e5a86abe7a8d529b43f1b4de0f730 100644 (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())?
+                }
             }
         }
     }