about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 32cfbd022c61..552016584af1 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -565,6 +565,11 @@ static bool isLive(const Path & path, const PathSet & livePaths,
     if (hasSuffix(path, ".lock") && tempRoots.find(string(path, 0, path.size() - 5)) != tempRoots.end())
         return true;
 
+    /* Don't delete .chroot directories for derivations that are
+       currently being built. */
+    if (hasSuffix(path, ".chroot") && tempRoots.find(string(path, 0, path.size() - 7)) != tempRoots.end())
+        return true;
+
     return false;
 }