]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Don't log failure when removing output file in hard link mode
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 2 Aug 2025 19:09:31 +0000 (21:09 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Aug 2025 11:45:20 +0000 (13:45 +0200)
If there is no preexisting output object file then we shouldn't indicate
an error.

src/ccache/ccache.cpp

index 4f6ecb2c557a5227e9976919eec39ce73554775a..64a0f48fcdbd6619684afc691fafd43b40c4a7ca 100644 (file)
@@ -1190,10 +1190,11 @@ to_cache(Context& ctx,
 
   if (ctx.config.hard_link()
       && !util::is_dev_null_path(ctx.args_info.output_obj)) {
-    // Workaround for Clang bug where it overwrites an existing object file
-    // when it's compiling an assembler file, see
-    // <https://bugs.llvm.org/show_bug.cgi?id=39782>.
-    util::remove_nfs_safe(ctx.args_info.output_obj);
+    // Workaround for Clang bug where it overwrites an existing object file when
+    // it's compiling an assembler file (see
+    // <https://bugs.llvm.org/show_bug.cgi?id=39782>): remove any preexisting
+    // output object file.
+    util::remove_nfs_safe(ctx.args_info.output_obj, util::LogFailure::no);
   }
 
   if (ctx.args_info.generating_diagnostics) {