[compiler-rt] b7f60d8 - [Compiler-rt] Downgrade another fatal error to warning

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Sat May 15 11:12:19 PDT 2021


Author: Dan Liew
Date: 2021-05-15T11:09:34-07:00
New Revision: b7f60d861ad7a8d03c09c0b72277eabaa53731fb

URL: https://github.com/llvm/llvm-project/commit/b7f60d861ad7a8d03c09c0b72277eabaa53731fb
DIFF: https://github.com/llvm/llvm-project/commit/b7f60d861ad7a8d03c09c0b72277eabaa53731fb.diff

LOG: [Compiler-rt] Downgrade another fatal error to warning

https://reviews.llvm.org/D101681 landed a change to check the testing
configuration which relies on using the `-print-runtime-dir` flag of
clang to determine where the runtime testing library is.

The patch treated not being able to find the path reported by clang
as an error. Unfortunately this seems to break the
`llvm-clang-win-x-aarch64` bot. Either the bot is misconfigured or
clang is reporting a bogus path.

To temporarily unbreak the bot downgrade the fatal error to a warning.
While we're here also print information about the command used to
determine the path to aid debugging.

Added: 
    

Modified: 
    compiler-rt/test/lit.common.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index 294703fb7fb8..12e2b220ad37 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -51,21 +51,27 @@ def get_path_from_clang(args, allow_failure):
         lit_config.warning(msg)
       else:
         lit_config.fatal(msg)
-    return path
+    return path, clang_cmd
 
   # Try using `-print-runtime-dir`. This is only supported by very new versions of Clang.
   # so allow failure here.
-  runtime_dir = get_path_from_clang(['-print-runtime-dir'], allow_failure=True)
+  runtime_dir, clang_cmd = get_path_from_clang(['-print-runtime-dir'], allow_failure=True)
   if runtime_dir:
     if os.path.exists(runtime_dir):
       return os.path.realpath(runtime_dir)
-    lit_config.fatal(f'Path reported by clang does not exist: {runtime_dir}')
+    # TODO(dliew): This should be a fatal error but it seems to trip the `llvm-clang-win-x-aarch64`
+    # bot which is likely misconfigured
+    lit_config.warning(
+      f'Path reported by clang does not exist: \"{runtime_dir}\". '
+      f'This path was found by running {clang_cmd}.'
+    )
+    return None
 
   # Fall back for older AppleClang that doesn't support `-print-runtime-dir`
   # Note `-print-file-name=<path to compiler-rt lib>` was broken for Apple
   # platforms so we can't use that approach here (see https://reviews.llvm.org/D101682).
   if config.host_os == 'Darwin':
-    lib_dir = get_path_from_clang(['-print-file-name=lib'], allow_failure=False)
+    lib_dir, _ = get_path_from_clang(['-print-file-name=lib'], allow_failure=False)
     runtime_dir = os.path.join(lib_dir, 'darwin')
     if not os.path.exists(runtime_dir):
       lit_config.fatal(f'Path reported by clang does not exist: {runtime_dir}')


        


More information about the llvm-commits mailing list