<p>Figured it out. I'm on MacOS and some docs that I followed mentioned turning on the sandbox feature by adding</p>
<pre><code>sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
</code></pre>
<p>to <code>/etc/nix/nix.conf</code>.</p>
<p>Removing these two lines eliminated the error.</p>

CC BY-SA 4.0
2022-01-20T11:43:30.570Z
I am in the Cohort 3, and following multiple guides as well, macOS i7 Monterey.  Do you still recommend removing those?  I see here it recommends adding, but no others do... https://github.com/input-output-hk/plutus-apps#nix-on-macos . I had issues building the client.
TheStophe
CC BY-SA 4.0
2021-09-23T15:25:24.060Z
2021-09-23T15:25:24.060Z
Paymahn Moghadasian
<p>I found this <code>/etc/nix/nix.conf</code> to work for my macOS i7 Monterey (v12.1).</p>
<p>It was recommended to turn the sandbox FALSE because 'not recommended' per Ref #1 below.</p>
<pre><code>    build-users-group = nixbld
    
    substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
    trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume
    
    sandbox = false
    extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
    experimental-features = nix-command
    extra-experimental-features = flakes
</code></pre>
<p>References:</p>
<ol>
<li><a href="https://cardano.stackexchange.com/a/6701/4012">CSE, @angerman, on macOS Monterey i7, what is the best <code>nix.conf</code> file to use?</a></li>
<li><a href="https://github.com/NixOS/nixpkgs/issues/116341" rel="nofollow noreferrer">Github: Status of macOS support in Nixpkgs
</a></li>
<li><a href="https://github.com/Til-D/cardano-plutus" rel="nofollow noreferrer">https://github.com/Til-D/cardano-plutus</a></li>
<li><a href="https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md" rel="nofollow noreferrer">https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md</a></li>
</ol>

CC BY-SA 4.0
2022-01-23T00:17:06.023Z
Answer could be improved by following these guidelines: [How to reference material written by others](https://cardano.stackexchange.com/help/referencing)
gRebel
CC BY-SA 4.0
2022-01-23T01:18:46.900Z
tracked down reference source and updated per comment.
TheStophe
CC BY-SA 4.0
2022-01-23T01:20:49.387Z
Well done, you get a whole upvote from me!  Sorry I can't do more.
gRebel
CC BY-SA 4.0
2022-01-22T18:02:15.307Z
2022-01-23T01:18:18.613Z
2022-01-23T01:18:18.613Z
TheStophe
<p>on debian distro, it works fine with all the details mentioned in developers forum. I built it on VS code debian distro with WSL2.  its tricky as sometime u need to execute chmod command as it wont let u access it.</p>

CC BY-SA 4.0
2021-09-23T18:49:54.487Z
2021-09-23T18:49:54.487Z
Amit
<p>I'm trying to get the exercises for week 1 of the plutus pioneer program working. I've installed nix and have set the IOHK caches.</p>
<p>When I try to run <code>nix build -f default.nix plutus.haskell.packages.plutus-core</code> in the plutus repo I get the following error:</p>
<pre><code> ❮❮❮ nix build -f default.nix plutus.haskell.packages.plutus-core
trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
builder for '/nix/store/gpkkaj0mcs6wxaknfjm0jh389x8l4gwb-plutus-core-0.1.0.0-coverage-report.drv' failed with exit code 65; last 1 log lines:
  sandbox-exec: pattern serialization length 71571 exceeds maximum (65535)
[0 built (1 failed), 0.0 MiB DL]
</code></pre>
<p>I'm running this command on commit <code>ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4</code>.</p>
<p>I've looked through the <a href="https://docs.plutus-community.com/" rel="nofollow noreferrer">plutus community docs</a> but haven't found any mention of this error.</p>
<p>Has anyone run into this before? What does this mean? Is there a known fix?</p>
<p>EDIT: this also happens on <code>master</code> at commit <code>8ce0d58c0a169f4c8a1104757502f342e750c863</code></p>

<plutus><plutus-pioneer-program><nix><macos>
Sandbox error when running nix build on macOS
# Sandbox error when running nix build on macOS

(Asked by: username_0 on 2021-09-21)

I'm trying to get the exercises for week 1 of the plutus pioneer program working. I've installed nix and have set the IOHK caches.
When I try to run nix build -f default.nix plutus.haskell.packages.plutus-core in the plutus repo I get the following error:
 ❮❮❮ nix build -f default.nix plutus.haskell.packages.plutus-core
trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
builder for '/nix/store/gpkkaj0mcs6wxaknfjm0jh389x8l4gwb-plutus-core-0.1.0.0-coverage-report.drv' failed with exit code 65; last 1 log lines:
  sandbox-exec: pattern serialization length 71571 exceeds maximum (65535)
[0 built (1 failed), 0.0 MiB DL]

I'm running this command on commit ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4.
I've looked through the plutus community docs but haven't found any mention of this error.
Has anyone run into this before? What does this mean? Is there a known fix?
EDIT: this also happens on master at commit 8ce0d58c0a169f4c8a1104757502f342e750c863

**Tags:** plutus, plutus-pioneer-program, nix, macos

---

## 3 answers

### Answer by username_0 on 2021-09-23. Score: 0 | Accepted answer

Figured it out. I'm on MacOS and some docs that I followed mentioned turning on the sandbox feature by adding
sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env

to /etc/nix/nix.conf.
Removing these two lines eliminated the error.

> **Comments:**
> **username_1**: I am in the Cohort 3, and following multiple guides as well, macOS i7 Monterey.  Do you still recommend removing those?  I see here it recommends adding, but no others do... https://github.com/input-output-hk/plutus-apps#nix-on-macos . I had issues building the client.  

---

### Answer by username_1 on 2022-01-22. Score: 1

I found this /etc/nix/nix.conf to work for my macOS i7 Monterey (v12.1).
It was recommended to turn the sandbox FALSE because 'not recommended' per Ref #1 below.
    build-users-group = nixbld
    
    substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
    trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume
    
    sandbox = false
    extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
    experimental-features = nix-command
    extra-experimental-features = flakes

References:

CSE, @angerman, on macOS Monterey i7, what is the best nix.conf file to use?
Github: Status of macOS support in Nixpkgs

https://github.com/Til-D/cardano-plutus
https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

> **Comments:**
> **username_2**: Answer could be improved by following these guidelines: [How to reference material written by others](https://cardano.stackexchange.com/help/referencing)  
> **username_1**: tracked down reference source and updated per comment.  
> **username_2**: Well done, you get a whole upvote from me!  Sorry I can't do more.  

---

### Answer by username_3 on 2021-09-23. Score: 0

on debian distro, it works fine with all the details mentioned in developers forum. I built it on VS code debian distro with WSL2. its tricky as sometime u need to execute chmod command as it wont let u access it.


---

