Skip to content

Commit

Permalink
Fix macos sandbox issue
Browse files Browse the repository at this point in the history
  • Loading branch information
P-E-Meunier committed Feb 28, 2025
1 parent 4d532d2 commit 06ffebf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libstore/unix/build/local-derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2148,12 +2148,12 @@ void LocalDerivationGoal::runChild()
// We create multiple allow lists, to avoid exceeding a limit in the darwin sandbox interpreter.
// See https://github.com/NixOS/nix/issues/4119
// We split our allow groups approximately at half the actual limit, 1 << 16
int initialLen = sandboxProfile.length();
const initialLen = sandboxProfile.length();
for (auto & i : pathsInChroot) {

if (sandboxProfile.length() - initialLen > (1 << 15)) {
if (sandboxProfile.length() - initialLen > (3 << 14)) {
debug("Sandbox break: %d %d", sandboxProfile.length(), initialLen);
sandboxProfile += ")\n(allow file-read* file-write* process-exec\n";
initialLen = sandboxProfile.length();
}

if (i.first != i.second.source)
Expand Down

0 comments on commit 06ffebf

Please sign in to comment.