about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-31T11·39+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-31T12·09+0200
commitc740c3ce500af2b7eb34651b5eeec01288d79dca (patch)
tree32e4e452ba8fd8ca7dec8ef64ae9e1f3b81f73c0
parent683a499ebbb3d5e8803feeab9097930a9ce91d3f (diff)
OS X sandbox: Store .sb file in $TMPDIR rather than the Nix store
The filename used was not unique and owned by the build user, so
builds could fail with

error: while setting up the build environment: cannot unlink ‘/nix/store/99i210ihnsjacajaw8r33fmgjvzpg6nr-bison-3.0.4.drv.sb’: Permission denied
-rw-r--r--src/libstore/build.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 92471b228d00..8695850b3441 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -778,7 +778,6 @@ private:
 #if __APPLE__
     typedef string SandboxProfile;
     SandboxProfile additionalSandboxProfile;
-    AutoDelete autoDelSandbox;
 #endif
 
     /* Hash rewriting. */
@@ -2711,9 +2710,7 @@ void DerivationGoal::runChild()
             debug("Generated sandbox profile:");
             debug(sandboxProfile);
 
-            Path sandboxFile = drvPath + ".sb";
-            deletePath(sandboxFile);
-            autoDelSandbox.reset(sandboxFile, false);
+            Path sandboxFile = tmpDir + "/.sandbox.sb";
 
             writeFile(sandboxFile, sandboxProfile);