[llvm] r313594 - [lit] Use realpath when adding to the config map.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 16:36:35 PDT 2017


Author: zturner
Date: Mon Sep 18 16:36:35 2017
New Revision: 313594

URL: http://llvm.org/viewvc/llvm-project?rev=313594&view=rev
Log:
[lit] Use realpath when adding to the config map.

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.

Modified:
    llvm/trunk/utils/lit/lit/discovery.py
    llvm/trunk/utils/llvm-lit/llvm-lit.in

Modified: llvm/trunk/utils/lit/lit/discovery.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/discovery.py?rev=313594&r1=313593&r2=313594&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/discovery.py (original)
+++ llvm/trunk/utils/lit/lit/discovery.py Mon Sep 18 16:36:35 2017
@@ -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)

Modified: llvm/trunk/utils/llvm-lit/llvm-lit.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-lit/llvm-lit.in?rev=313594&r1=313593&r2=313594&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-lit/llvm-lit.in (original)
+++ llvm/trunk/utils/llvm-lit/llvm-lit.in Mon Sep 18 16:36:35 2017
@@ -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)




More information about the llvm-commits mailing list