1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

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
This commit is contained in:
Eelco Dolstra 2017-05-31 13:39:27 +02:00 committed by Matthew Bauer
parent 23795d47fb
commit 35f541a7a0

View file

@ -778,7 +778,6 @@ private:
#if __APPLE__ #if __APPLE__
typedef string SandboxProfile; typedef string SandboxProfile;
SandboxProfile additionalSandboxProfile; SandboxProfile additionalSandboxProfile;
AutoDelete autoDelSandbox;
#endif #endif
/* Hash rewriting. */ /* Hash rewriting. */
@ -2633,9 +2632,7 @@ void DerivationGoal::runChild()
debug("Generated sandbox profile:"); debug("Generated sandbox profile:");
debug(sandboxProfile); debug(sandboxProfile);
Path sandboxFile = drvPath + ".sb"; Path sandboxFile = tmpDir + "/.sandbox.sb";
if (pathExists(sandboxFile)) deletePath(sandboxFile);
autoDelSandbox.reset(sandboxFile, false);
writeFile(sandboxFile, sandboxProfile); writeFile(sandboxFile, sandboxProfile);