[libcxx-commits] [libcxx] [libc++][lit] Atomically update the persistent cache (PR #66538)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 15 13:07:55 PDT 2023


================
@@ -69,8 +69,12 @@ def f(config, *args, **kwargs):
             if cacheKey not in cache:
                 cache[cacheKey] = function(config, *args, **kwargs)
                 # Update the persistent cache so it knows about the new key
-                with open(persistentCache, "wb") as cacheFile:
+                # We write to a temporary file and rename the result to ensure
----------------
ldionne wrote:

Don't we have the same problem with the creation of the `.tmp` file now? Don't we need to generate a unique file name instead?

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


More information about the libcxx-commits mailing list