[llvm] 20cb7a9 - This might actually fix the Windows bots after a16ba6fea.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 19:23:12 PDT 2020


Author: Nico Weber
Date: 2020-04-02T22:22:54-04:00
New Revision: 20cb7a904fc7db9aa07512a2304b1f9365d6518c

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

LOG: This might actually fix the Windows bots after a16ba6fea.

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 29eacf260586..91bec7d80813 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1455,9 +1455,18 @@ function(configure_lit_site_cfg site_in site_out)
 
   set(LIT_SITE_CFG_IN_HEADER  "# Autogenerated from ${site_in}\n# Do not edit!")
 
+  # Lit converts config paths to lower case in discovery.py, before
+  # loading the config. This causes __file__ to be all lower-case (including
+  # the drive letter), but several clang tests pass -include %s and a
+  # clang warning checks that passed case matches on-disk cache. So it's
+  # important that this restores the on-disk case of the prefix.
   string(CONCAT LIT_SITE_CFG_IN_HEADER "${LIT_SITE_CFG_IN_HEADER}\n\n"
     "# Allow generated lit.site.cfg.py to be relocatable.\n"
-    "def path(p): return os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/') if p else ''\n"
+    "def path(p):\n"
+    "  if not p: return ''\n"
+    "  p = os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/')\n"
+    "  if os.name == 'nt' and os.path.isabs(p): return p[0].upper() + p[1:]\n"
+    "  return p\n"
     )
 
   # Override config_target_triple (and the env)


        


More information about the llvm-commits mailing list