From b30d1e7ada0a8fbaacc25e24e5e788d18bfe8d3c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Dec 2016 21:38:58 +0100 Subject: Don't delete .check directories of running builds We need to keep them around for diffoscope. --- src/libstore/build.cc | 4 ++-- src/libstore/gc.cc | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 01a9d027b96f..c970fbdcaa65 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2687,7 +2687,7 @@ void DerivationGoal::registerOutputs() outputs to allow hard links between outputs. */ InodesSeen inodesSeen; - Path checkSuffix = "-check"; + Path checkSuffix = ".check"; bool runDiffHook = settings.get("run-diff-hook", false); bool keepPreviousRound = settings.keepFailed || runDiffHook; @@ -2962,7 +2962,7 @@ void DerivationGoal::registerOutputs() return; } - /* Remove the -check directories if we're done. FIXME: keep them + /* Remove the .check directories if we're done. FIXME: keep them if the result was not determistic? */ if (curRound == nrRounds) { for (auto & i : drv->outputs) { diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index ae03604faf98..f8c4a07238c7 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -621,6 +621,11 @@ void LocalStore::tryToDelete(GCState & state, const Path & path) /* Don't delete .chroot directories for derivations that are currently being built. */ if (isActiveTempFile(state, path, ".chroot")) return; + + /* Don't delete .check directories for derivations that are + currently being built, because we may need to run + diff-hook. */ + if (isActiveTempFile(state, path, ".check")) return; } PathSet visited; -- cgit 1.4.1