llvm.org GIT mirror llvm / a53d6c2
lit: Let lit.util.which() return a normcase()ed path LLVMConfig.with_environment() uses os.path.normcase(os.path.normpath(x)) to normalize temporary env vars. LLVMConfig.use_clang() uses with_environment() to temporarily set PATH and then look for clang there. This means that on Windows, clang will be run with a path like c:\foo\bin\clang.EXE (with a lower-case "C:"). lit.util.which() used to not do this, which means the executables added in clang/test/lit.cfg.py (e.g. c-index-test) were run with a path like C:\foo\bin\c-index-test.EXE (because both CMake and GN happen to write clang_tools_dir with an upper-case C to lit.site.cfg.py). clang/test/Index/pch-from-libclang.c requires that both c-index-test and clang use _exactly_ the same resource dir path (same case and everything), because a hash of the resource directory is used as module cache path. This patch is necessary but not sufficient to make pch-from-libclang.c pass on Windows. Differential Revision: https://reviews.llvm.org/D57343 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352704 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 6 months ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
197197 # Check for absolute match first.
198198 if os.path.isabs(command) and os.path.isfile(command):
199 return os.path.normpath(command)
199 return os.path.normcase(os.path.normpath(command))
201201 # Would be nice if Python had a lib function for this.
202202 if not paths:
214214 for ext in pathext:
215215 p = os.path.join(path, command + ext)
216216 if os.path.exists(p) and not os.path.isdir(p):
217 return os.path.normpath(p)
217 return os.path.normcase(os.path.normpath(p))
219219 return None