[PATCH] D31096: LTO, Support: Add a safeguard against pruning a directory that is not a cache directory.

Ivan Krasin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 13:15:30 PDT 2017


krasin added a comment.

I believe this approach is too fragile, in particular because if llvmcache.timestamp is deleted, the cache no longer works, but the directory exists. That creates a broken state and user will have to learn about how the cache works. That breaks the principle of least surprise.

It would be a major problem, if it gets broken on a bot where no easy access to the filesystem exists.

Also,  this approach makes tests cumbersome, as we can see in this CL.



================
Comment at: lld/test/ELF/lto/cache.ll:18
+
+; RUN: rm -Rf %t.cache2 && mkdir %t.cache2
+; RUN: touch -t 197001010000 %t.cache2/foo
----------------
Why is -R needed?


https://reviews.llvm.org/D31096





More information about the llvm-commits mailing list