<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi David,</div><div><br></div><div>I believe this was rather caused by r343460 and then fixed in r343488 (sorry about the delay between the two!)</div><div>The change in symlink behavior was deliberate but I didn't expect the clang tests to depend on it.</div><div><br></div><div>Please let me know if this is still broken after r343488.</div><div><br></div><div>Cheers, Sam</div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 2, 2018 at 4:32 AM David Greene <<a href="mailto:dag@cray.com">dag@cray.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These tests are broken on X86-64 and AArch64 SLES 12:<br>
<br>
[ FAILED ] 2 tests, listed below:<br>
[ FAILED ] VirtualFileSystemTest.BrokenSymlinkRealFSIteration<br>
[ FAILED ] VirtualFileSystemTest.BrokenSymlinkRealFSRecursiveIteration<br>
<br>
/clang/unittests/Basic/VirtualFileSystemTest.cpp:443: Failure<br>
Value of: I->path() == _b<br>
Actual: false<br>
Expected: true<br>
/clang/unittests/Basic/VirtualFileSystemTest.cpp:443: Failure<br>
Value of: I->path() == _b<br>
Actual: false<br>
Expected: true<br>
[ FAILED ] VirtualFileSystemTest.BrokenSymlinkRealFSIteration (1 ms)<br>
[ RUN ] VirtualFileSystemTest.BasicRealFSRecursiveIteration<br>
[ OK ] VirtualFileSystemTest.BasicRealFSRecursiveIteration (0 ms)<br>
[ RUN ] VirtualFileSystemTest.BrokenSymlinkRealFSRecursiveIteration<br>
/clang/unittests/Basic/VirtualFileSystemTest.cpp:534: Failure<br>
Expected: ExpectedBrokenSymlinks.size()<br>
Which is: 5<br>
To be equal to: VisitedBrokenSymlinks.size()<br>
Which is: 0<br>
/clang/unittests/Basic/VirtualFileSystemTest.cpp:538: Failure<br>
Expected: ExpectedNonBrokenSymlinks.size()<br>
Which is: 5<br>
To be equal to: VisitedNonBrokenSymlinks.size()<br>
Which is: 10<br>
/clang/unittests/Basic/VirtualFileSystemTest.cpp:541: Failure<br>
Value of: std::equal(VisitedNonBrokenSymlinks.begin(), VisitedNonBrokenSymlinks.end(), ExpectedNonBrokenSymlinks.begin()) <br>
Actual: false<br>
Expected: true<br>
[ FAILED ] VirtualFileSystemTest.BrokenSymlinkRealFSRecursiveIteration (1 ms)<br>
<br>
The first failures (path inequality) are caused by the directory iterators not<br>
skipping broken symlinks. I did not dive deeply into the other failures as I<br>
assume they show the same issue.<br>
<br>
This commit appears to have caused the regression:<br>
<br>
commit 446fa15e649709fc8bde40ed422d1e4794ac9559<br>
Author: Sam McCall <<a href="mailto:sam.mccall@gmail.com" target="_blank">sam.mccall@gmail.com</a>><br>
Date: Fri Sep 14 12:47:38 2018 +0000<br>
<br>
[VFS] vfs::directory_iterator yields path and file type instead of full Status<br>
<br>
Summary:<br>
Most callers I can find are using only `getName()`. Type is used by the<br>
recursive iterator.<br>
<br>
Now we don't have to call stat() on every listed file (on most platforms).<br>
Exceptions are e.g. Solaris where readdir() doesn't include type information.<br>
On those platforms we'll still stat() - see D51918.<br>
<br>
The result is significantly faster (stat() can be slow).<br>
My motivation: this may allow us to improve clang IO on large TUs with long<br>
include search paths. Caching readdir() results may allow us to skip many stat()<br>
and open() operations on nonexistent files.<br>
<br>
Reviewers: bkramer<br>
<br>
Subscribers: fedor.sergeev, cfe-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D51921" rel="noreferrer" target="_blank">https://reviews.llvm.org/D51921</a><br>
<br>
git-svn-id: <a href="https://llvm.org/svn/llvm-project/cfe/trunk@342232" rel="noreferrer" target="_blank">https://llvm.org/svn/llvm-project/cfe/trunk@342232</a> 91177308-0d34-0410-b5e6-96231b3b80d8 <br>
<br>
I am not well versed enough in the VFS layer to propose a fix, but I am<br>
happy to help test patches.<br>
<br>
-David<br>
</blockquote></div>