From e12cf82782d9a8c799c9dfff347866eca95e9f4a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Aug 2015 11:13:31 +0200 Subject: [PATCH] Prevent .chroot from being GC'ed when using LocalStore::buildDerivation() Fixes #616. --- src/libstore/build.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 1eb7e806c..2e3a22218 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); }