about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-25T15·49+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-25T15·49+0000
commitd06be428f6dd046c89a69995d5328b8250bec3d2 (patch)
treec1154d3e0ac81a78c3cb9aa0b8098ab3dc874275 /src/libstore/build.cc
parentabec1c000410a1533f9c80357be6061730d8c6aa (diff)
* Disable chroot builds for fixed-output derivations so that we don't
  need /etc in the chroot (in particular, /etc/resolv.conf for
  fetchurl).  Not having /etc/resolv.conf in the chroot is a good
  thing, since we don't want normal derivations to download files.

Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 33a53c148f13..c5807d32f7ee 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1610,6 +1610,7 @@ void DerivationGoal::startBuilder()
     }
 
     // The same for derivations
+    // !!! urgh, cut&paste duplication
     s = drv.env["exportBuildReferencesGraph"];
     ss = tokenizeString(s);
     if (ss.size() % 2 != 0)
@@ -1685,10 +1686,16 @@ void DerivationGoal::startBuilder()
     }
 
 
-    /* Are we doing a chroot build? */
+    /* Are we doing a chroot build?  Note that fixed-output
+       derivations are never done in a chroot, mainly so that
+       functions like fetchurl (which needs a proper /etc/resolv.conf)
+       work properly.  Purity checking for fixed-output derivations
+       is somewhat pointless anyway. */
     useChroot = queryBoolSetting("build-use-chroot", false);
     Path tmpRootDir;
 
+    if (fixedOutput) useChroot = false;
+
     if (useChroot) {
 #if CHROOT_ENABLED
         /* Create a temporary directory in which we set up the chroot