From 0df147b145f787377c4a883a9dbb1ad28c7405e3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Aug 2025 16:40:37 +0200 Subject: [PATCH] Bump the version of the SQLite caches This avoids problems with older versions of Nix that don't put the caches in WAL mode. That's generally not a problem, until you do something like nix build --print-out-paths ... | cachix which deadlocks because cachix tries to switch the caches to truncate mode, which requires exclusive access. But the first process cannot make progress because the cachix process isn't reading from the pipe. --- src/libexpr/eval-cache.cc | 2 +- src/libfetchers/cache.cc | 2 +- src/libstore/nar-info-disk-cache.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index 4115196c5..3ec344c41 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -69,7 +69,7 @@ struct AttrDb { auto state(_state->lock()); - auto cacheDir = std::filesystem::path(getCacheDir()) / "eval-cache-v5"; + auto cacheDir = std::filesystem::path(getCacheDir()) / "eval-cache-v6"; createDirs(cacheDir); auto dbPath = cacheDir / (fingerprint.to_string(HashFormat::Base16, false) + ".sqlite"); diff --git a/src/libfetchers/cache.cc b/src/libfetchers/cache.cc index 85fd94590..85a33e472 100644 --- a/src/libfetchers/cache.cc +++ b/src/libfetchers/cache.cc @@ -37,7 +37,7 @@ struct CacheImpl : Cache { auto state(_state.lock()); - auto dbPath = getCacheDir() + "/fetcher-cache-v3.sqlite"; + auto dbPath = getCacheDir() + "/fetcher-cache-v4.sqlite"; createDirs(dirOf(dbPath)); state->db = SQLite(dbPath); diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index 0350c874a..69d8d2e14 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -86,7 +86,7 @@ public: Sync _state; - NarInfoDiskCacheImpl(Path dbPath = getCacheDir() + "/binary-cache-v6.sqlite") + NarInfoDiskCacheImpl(Path dbPath = getCacheDir() + "/binary-cache-v7.sqlite") { auto state(_state.lock());