[PATCH] D82138: Diagnostic message (error) related to ThinLTO caching needs to be downgraded to a remark

Katya Romanova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 20:11:45 PDT 2020


kromanova created this revision.
kromanova added reviewers: mehdi_amini, tejohnson.
Herald added subscribers: llvm-commits, dexonsmith, steven_wu, hiraditya, inglorion.
Herald added a project: LLVM.

This is a fix for PR #46392 (Diagnostic message (error) related to ThinLTO caching needs to be downgraded to a remark).

There are diagnostic messages related to ThinLTO caching that contain the word "error", but they are really just notices/remarks for users, and they don't cause a build failure. The word "error" appearing can be confusing to users, and may even cause deeper problems.

User's build system might be designed to interpret any error messages (even a benign error message as the one above) reported by the compiler as a build failure, thus causing the build to fail "needlessly". In short, the term "error" in this diagnostic is misleading at best, and may be causing build systems to fail at worst.

We would like to downgrade this "error" message to a diagnostic remark.

There is another error message that needs to be downgraded to a remark, since it’s benign too...

  errs() << "error: can't reload cached file '" << CacheEntryPath
        << "': " << EC.message() << "\n";


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82138

Files:
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp


Index: llvm/lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -894,7 +894,7 @@
     // Copy failed (could be because the CacheEntry was removed from the cache
     // in the meantime by another process), fall back and try to write down the
     // buffer to the output.
-    errs() << "error: can't link or copy from cached entry '" << CacheEntryPath
+    errs() << "remark: can't link or copy from cached entry '" << CacheEntryPath
            << "' to '" << OutputPath << "'\n";
   }
   // No cache entry, just write out the buffer.
@@ -1134,7 +1134,7 @@
             auto ReloadedBufferOrErr = CacheEntry.tryLoadingBuffer();
             if (auto EC = ReloadedBufferOrErr.getError()) {
               // On error, keep the preexisting buffer and print a diagnostic.
-              errs() << "error: can't reload cached file '" << CacheEntryPath
+              errs() << "remark: can't reload cached file '" << CacheEntryPath
                      << "': " << EC.message() << "\n";
             } else {
               OutputBuffer = std::move(*ReloadedBufferOrErr);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82138.271895.patch
Type: text/x-patch
Size: 1207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200619/3b92f216/attachment.bin>


More information about the llvm-commits mailing list