[PATCH] D38015: [lit] Use inodes instead of realpaths in the config map

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 17:41:36 PDT 2017


zturner created this revision.
Herald added a reviewer: modocache.

This should better address symlinks and other weird situations instead of relying on path string comparisons.


https://reviews.llvm.org/D38015

Files:
  llvm/utils/lit/lit/discovery.py


Index: llvm/utils/lit/lit/discovery.py
===================================================================
--- llvm/utils/lit/lit/discovery.py
+++ llvm/utils/lit/lit/discovery.py
@@ -48,10 +48,8 @@
         # 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)
+            source_inode = os.stat(cfgpath)
+            target = config_map.get(source_inode)
             if target:
                 cfgpath = target
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38015.115766.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170919/c4857304/attachment.bin>


More information about the llvm-commits mailing list