[PATCH] D117730: [DNM][VFS] Do not overwrite the path when nesting RedirectingFileSystems
Ben Barham via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 19 16:30:21 PST 2022
bnbarham created this revision.
Herald added subscribers: dexonsmith, hiraditya.
bnbarham requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.
86e2af8043c7728710a711b623f27425801a36c3 <https://reviews.llvm.org/rG86e2af8043c7728710a711b623f27425801a36c3> aimed to preserve the original
relative path when falling back to the external filesystem. But when
there's nested `RedirectingFileSystems` this results in the outer-most
VFS overwriting the path of a lower VFS.
For example, take a directory remapping overlay of `A -> B` and another
of `B -> C` where both have `use-external-names` set. If `A/foo` is
requested this will map `A/foo` to `B/foo` to `C/foo` but when this
result returns to the `A -> B` VFS, it will then remap the `Status` and
`File` to `B/foo` instead.
This is only a partial fix - it fixes `openFileForRead`, but `status`
and `getRealPath` would need equivalent changes. I'm putting up this
partial PR to gather opinions on whether this seems reasonable first.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117730
Files:
clang/test/VFS/directory.c
llvm/include/llvm/Support/VirtualFileSystem.h
llvm/lib/Support/FileCollector.cpp
llvm/lib/Support/VirtualFileSystem.cpp
llvm/unittests/Support/VirtualFileSystemTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117730.401436.patch
Type: text/x-patch
Size: 19594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220120/5eea73e9/attachment-0001.bin>
More information about the cfe-commits
mailing list