[PATCH] D121423: [VFS] OverlayFileSystem should consistently use the last-added FS first
    Ben Barham via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar 11 11:38:24 PST 2022
    
    
  
bnbarham added a comment.
`clang-tidy/infrastructure/empty-database.cpp` is failing because `setCurrentWorkingDirectory("")` previously returned an error and no longer does.
It would have run on the RealFileSystem with a *process linked* CWD previously, which really just runs a `chdir`. chdir errors if the path doesn't exist. It now successfully sets on the InMemoryFileSystem since it checks nothing. This raises a few couple interesting questions:
1. The implementation of `setCurrentWorkingDirectory` is different for the non-process linked case. It first makes the path absolute and then errors if that path doesn't exist. So if that was being used, we also wouldn't error here (it would effectively be a no-op).
2. Should InMemoryFileSystem fail to set the CWD if the directory doesn't exist? I was considering doing this before I noticed this test failing, since it seems inconsistent with the other implementation. Thoughts?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121423/new/
https://reviews.llvm.org/D121423
    
    
More information about the llvm-commits
mailing list