about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-24T09·13+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-24T09·13+0200
commite12cf82782d9a8c799c9dfff347866eca95e9f4a (patch)
treeff4d4da23f9a547b70bc5c1e868c81dc978d8282 /src/libstore/build.cc
parenteadb86f44726e12988d5f21b47e4c54b49b2092b (diff)
Prevent .chroot from being GC'ed when using LocalStore::buildDerivation()
Fixes #616.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 1eb7e806ca63..2e3a2221857e 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -911,6 +911,10 @@ DerivationGoal::DerivationGoal(const Path & drvPath, const BasicDerivation & drv
     state = &DerivationGoal::haveDerivation;
     name = (format("building of %1%") % showPaths(outputPaths(drv))).str();
     trace("created");
+
+    /* Prevent the .chroot directory from being
+       garbage-collected. (See isActiveTempFile() in gc.cc.) */
+    worker.store.addTempRoot(drvPath);
 }