[PATCH] D78169: [lit] Keep original cfg file case around.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 18:03:44 PDT 2020


Meinersbur added inline comments.


================
Comment at: llvm/utils/lit/lit/discovery.py:67
         cfg.load_from_path(cfgpath, litConfig)
         source_root = os.path.realpath(cfg.test_source_root or path)
         exec_root = os.path.realpath(cfg.test_exec_root or path)
----------------
Although it turned out to be unrelated to this patch, I leave this comment here:

check-clang started to fail with these kind of error messages:
```
FAIL: Clang :: SemaObjC/selector-4.m (1 of 1)
******************** TEST 'Clang :: SemaObjC/selector-4.m' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\users\meinersbur\build\llvm-project\release\bin\clang.exe -cc1 -internal-isystem c:\users\meinersbur\build\llvm-project\release\lib\clang\11.0.0\include -nostdsysteminc -Wselector -x objective-c C:\users\meinersbur\src\llvm-project\clang\test\SemaObjC\selector-4.m -include C:\users\meinersbur\src\llvm-project\clang\test\SemaObjC\selector-4.m -verify
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\users\meinersbur\build\llvm-project\release\bin\clang.exe" "-cc1" "-internal-isystem" "c:\users\meinersbur\build\llvm-project\release\lib\clang\11.0.0\include" "-nostdsysteminc" "-Wselector" "-x" "objective-c" "C:\users\meinersbur\src\llvm-project\clang\test\SemaObjC\selector-4.m" "-include" "C:\users\meinersbur\src\llvm-project\clang\test\SemaObjC\selector-4.m" "-verify"
# command stderr:
error: 'warning' diagnostics seen but not expected:
  Line 1: non-portable path to file '"C\\Users\meinersbur\src\llvm-project\clang\test\SemaObjC\selector-4.m"'; specified path differs in case from file name on disk
1 error generated.

error: command failed with exit status: 1
```
The `C\\` resulted from some printing problem, but what cause the issue was `-include C:\users\....` with lower-case 'U' while the folder is upper case in the file system. It is the expansion of `%s` by lit.

Why would lit pass the wrong case? I suspected this patch. 

The lower-case "user" originates from `__file__` in Clang's `lit.cfg.py` assigned to `config.test_source_root`, which is used by `Test.getSourcePath()` to use as the substitution of `%s`. No idea why `__file__` would not use the proper file's case, bit this call of `os.path.realpath` might have been intended to return the correct case. 

Except, it doesn't. At least in the Python 3.7 that ships with the current Visual Studio. However, Python 3.8 changes the case from `user` to `User`. So my solution is to use Python 3.8 from now on, but I have no idea why it worked before or why nobody else seem to have the same problem. I leave this here in case might be useful to someone else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78169/new/

https://reviews.llvm.org/D78169





More information about the llvm-commits mailing list