]> granicus.if.org Git - llvm/commitdiff
[lit] Use realpath when adding to the config map.
authorZachary Turner <zturner@google.com>
Mon, 18 Sep 2017 23:36:35 +0000 (23:36 +0000)
committerZachary Turner <zturner@google.com>
Mon, 18 Sep 2017 23:36:35 +0000 (23:36 +0000)
Since the path a user specifies to the llvm-lit script might be
different than the source tree they built from (since they could
be behind different symlinks), we need to use realpath to make
sure that path comparisons work as expected.

Even better would be to use a custom dictionary comparison with
actual file equivalence comparison semantics, but this is the
least friction to unbreak things for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313594 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/discovery.py
utils/llvm-lit/llvm-lit.in

index a5902d365df3d0a93e10a1240ae8a4d203f52084..e276829db39d1b6841349084948cd1d53d1a7502 100644 (file)
@@ -48,6 +48,7 @@ def getTestSuite(item, litConfig, cache):
         # configuration to load instead.
         config_map = litConfig.params.get('config_map')
         if config_map:
+            cfgpath = os.path.realpath(cfgpath)
             cfgpath = os.path.normpath(cfgpath)
             cfgpath = os.path.normcase(cfgpath)
             target = config_map.get(cfgpath)
index efad97ade7e24fb1968ebdde155654dea91c8538..a12056dcc55941e1a3123278fa5221814efb2389 100755 (executable)
@@ -7,6 +7,7 @@ config_map = {}
 
 def map_config(source_dir, site_config):
     global config_map
+    source_dir = os.path.realpath(source_dir)
     source_dir = os.path.normpath(source_dir)
     source_dir = os.path.normcase(source_dir)
     site_config = os.path.normpath(site_config)