about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/build.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 6c40b6686dcc..b62991dff0f3 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1875,6 +1875,13 @@ void DerivationGoal::startBuilder()
             }
         }
 
+        /* If we're repairing, it's possible that we're rebuilding a
+           path that is in settings.dirsInChroot (typically the
+           dependencies of /bin/sh).  Throw them out. */
+        if (repair)
+            foreach (DerivationOutputs::iterator, i, drv.outputs)
+                dirsInChroot.erase(i->second.path);
+
 #else
         throw Error("chroot builds are not supported on this platform");
 #endif