about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--release.nix7
-rw-r--r--src/libstore/build.cc8
2 files changed, 11 insertions, 4 deletions
diff --git a/release.nix b/release.nix
index c5f700d8e776..47ba1c1c3e8d 100644
--- a/release.nix
+++ b/release.nix
@@ -95,11 +95,10 @@ let
 
         # Provide a default value for the ‘build-chroot-dirs’ setting
         # that includes /bin/sh pointing to bash.
-        preHook = lib.optionalString stdenv.isLinux (
-          let sh = stdenv.shell; in
+        preHook = lib.optionalString stdenv.isLinux
           ''
-            export DEFAULT_CHROOT_DIRS="/bin/sh=${sh} $(tr '\n' ' ' < ${writeReferencesToFile sh})"
-          '');
+            export DEFAULT_CHROOT_DIRS="/bin/sh=${stdenv.shell}"
+          '';
 
         enableParallelBuilding = true;
 
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 88efb9a65d1a..1c510fa7d514 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1799,6 +1799,14 @@ void DerivationGoal::startBuilder()
         }
         dirsInChroot[tmpDir] = tmpDir;
 
+        /* Add the closure of store paths to the chroot. */
+        PathSet closure;
+        for (auto & i : dirsInChroot)
+            if (isInStore(i.second))
+                computeFSClosure(worker.store, toStorePath(i.second), closure);
+        for (auto & i : closure)
+            dirsInChroot[i] = i;
+
         string allowed = settings.get("allowed-impure-host-deps", string(DEFAULT_ALLOWED_IMPURE_PREFIXES));
         PathSet allowedPaths = tokenizeString<StringSet>(allowed);