Skip to content

Commit 5ccfa15

Browse files
committed
[lit] abs_path_preserve_drive - don't normalize path, leave this to the caller
As noted on D154130, this was preventing path matching between normalized/unnormalized paths on some windows builds.
1 parent 5b19f42 commit 5ccfa15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/utils/lit/lit/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def search1(path):
5757
config_map = litConfig.params.get("config_map")
5858
if config_map:
5959
cfgpath = util.abs_path_preserve_drive(cfgpath)
60-
target = config_map.get(cfgpath)
60+
target = config_map.get(os.path.normcase(cfgpath))
6161
if target:
6262
cfgpath = target
6363

llvm/utils/lit/lit/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ def abs_path_preserve_drive(path):
138138
# Since Python 3.8, os.path.realpath resolves sustitute drives,
139139
# so we should not use it. In Python 3.7, os.path.realpath
140140
# was implemented as os.path.abspath.
141-
return os.path.normpath(os.path.abspath(path))
141+
return os.path.abspath(path)
142142
else:
143143
# On UNIX, the current directory always has symbolic links resolved,
144144
# so any program accepting relative paths cannot preserve symbolic
145145
# links in paths and we should always use os.path.realpath.
146-
return os.path.normpath(os.path.realpath(path))
146+
return os.path.realpath(path)
147147

148148
def mkdir(path):
149149
try:

0 commit comments

Comments
 (0)