No tests for -ivfsoverlay run on Windows
| Bugzilla Link | 43272 |
| Resolution | FIXED |
| Resolved on | Dec 20, 2019 08:58 |
| Version | 8.0 |
| OS | Windows NT |
| CC | @amccarth-google,@Bigcheese,@dwblaikie,@jkorous-apple,@zygoloid,@sam-mccall |
Extended Description
The largest source of REQUIRES:shell tests in clang/test seems to come from tests for -ivfsoverlay. Nobody seems to have taken the time to get these tests to pass on Windows, so they are marked as REQUIRES:shell. However, they do not need bash, these tests would pass on Linux with lit's internal shell, so we should replace that with UNSUPPORTED:system-windows first.
Second, these tests don't port to Windows due to these sed commands:
// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" -e "s:EXTERNAL_NAMES:true:" %S/Inputs/use-external-names.yaml > %t.external.yaml // RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" -e "s:EXTERNAL_NAMES:false:" %S/Inputs/use-external-names.yaml > %t.yaml
This is very easily fixed by avoiding colons and using %/t to work around the string escaping issues:
// RUN: sed -e "s@INPUT_DIR@%/S/Inputs@g" -e "s@OUT_DIR@%/t@g" -e "s@EXTERNAL_NAMES@true@" %S/Inputs/use-external-names.yaml > %t.external.yaml // RUN: sed -e "s@INPUT_DIR@%/S/Inputs@g" -e "s@OUT_DIR@%/t@g" -e "s@EXTERNAL_NAMES@false@" %S/Inputs/use-external-names.yaml > %t.yaml
At this point, I'm stuck, because the tests still don't pass. The yaml files look like this now:
{ 'version': 0, 'use-external-names': true, 'roots': [{ 'type': 'file', 'name': 'C:/src/llvm-project/build/tools/clang/test/VFS/Output/external-names.c.tmp/external-names.h', 'external-contents': 'C:/src/llvm-project/clang/test/VFS/Inputs/external-names.h' }] }
If I use "native" paths for 'name' instead, then the test passes. Now it looks like this: 'name': 'C:\src\llvm-project\build\tools\clang\test\VFS\Output\external-names.c.tmp\external-names.h',
I can find a place in the code to insert llvm::sys::path::native, but I'm wondering if this hides a deeper issue, so I figured I'd file a bug for it.
mentioned in issue llvm/llvm-bugzilla-archive#44221
I'm going to do some more work to improve the portability of this code, but the tests now run and pass on Windows.
Patch https://reviews.llvm.org/D70701 (pending review) will fix all but one of the remainging VFS tests on Windows.
The last one fails for an issue unrelated to VFS, so I've created a new PR to track that: llvm/llvm-bugzilla-archive#44221
All but four of the VFS tests now run on Windows. Also, three Clang tests that depend on VFS but weren't about VFS were also enabled.
https://github.com/llvm/llvm-project/commit/1275ab1620b665eb06231ce3c4e5068c97d9b618
I'm looking into the remaining tests.
Sorry, I just added one more.
d6609a404fe [NFC] Fix ubsan-blacklist test
I'll look into it.
I'm making progress here. 11/15 tests now pass on Windows. Unfortunately, new problems appear each time I yank on a thread. I'm leaving on vacation tomorrow, but plan to return to this at the beginning of October.
I'm happy to look into the "deeper issue" of handling generic and native path names.
assigned to @amccarth-google