[llvm] [Support] Use std::filesystem::remove_all() in remove_directories() (PR #119146)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 03:44:11 PST 2024


mstorsjo wrote:

I think the reason it hangs is because this test intentionally tries to create a deep nested structure of paths, like `/tmp/file-system-test-ed4fa1/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss/DirNameWith19Charss`, and this fails in the libstdc++ implementation. See https://github.com/llvm/llvm-project/blob/llvmorg-19.1.5/llvm/unittests/Support/Path.cpp#L1050-L1063 for reference for this test.

So that makes the issue a bit easier to understand; libstdc++'s implementation of `std::filesystem` is not safe for long paths on Windows.

https://github.com/llvm/llvm-project/pull/119146


More information about the llvm-commits mailing list