]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
chore: Remove special logic for cleaning up legacy ccache files
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 9 Nov 2022 20:36:03 +0000 (21:36 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 11 Jan 2023 18:42:29 +0000 (19:42 +0100)
src/storage/local/LocalStorage_cleanup.cpp

index 1293af4ac77efe724c92d5ccc82143e060cd208f..d3e8754ea6970b85ad3b08e03cf37626a914308e 100644 (file)
@@ -191,24 +191,6 @@ LocalStorage::clean_dir(const std::string& subdir,
       }
     }
 
-    if (util::ends_with(file.path(), ".stderr")) {
-      // In order to be nice to legacy ccache versions, make sure that the .o
-      // file is deleted before .stderr, because if the ccache process gets
-      // killed after deleting the .stderr but before deleting the .o, the
-      // cached result will be inconsistent. (.stderr is the only file that is
-      // optional for legacy ccache versions; any other file missing from the
-      // cache will be detected.)
-      std::string o_file = file.path().substr(0, file.path().size() - 6) + "o";
-
-      // Don't subtract this extra deletion from the cache size; that
-      // bookkeeping will be done when the loop reaches the .o file. If the
-      // loop doesn't reach the .o file since the target limits have been
-      // reached, the bookkeeping won't happen, but that small counter
-      // discrepancy won't do much harm and it will correct itself in the next
-      // cleanup.
-      delete_file(o_file, 0, nullptr, nullptr);
-    }
-
     delete_file(file.path(), file.size_on_disk(), &cache_size, &files_in_cache);
     cleaned = true;
   }