Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macOS sandbox build #4276

Merged
merged 1 commit into from Nov 23, 2020
Merged

Fix macOS sandbox build #4276

merged 1 commit into from Nov 23, 2020

Conversation

B4dM4n
Copy link
Contributor

@B4dM4n B4dM4n commented Nov 23, 2020

Since c4c3c15 (#4251) building Nix for macOS with sandboxing fails:

getting status of /nix/var/nix/profiles/per-user/root/channels/nixpkgs: Operation not permitted

This happens, because EvalSettings::getDefaultNixPath tries to access paths outside the sandbox. Since the state-dir is not required for doc generation, it is set to the dummy folder. This needs to be done for all nix invocations during doc generation, as EvalSettings::getDefaultNixPath is called unconditionally.

Since c4c3c15 (NixOS#4251) building Nix for
macOS with sandboxing fails:
```
getting status of /nix/var/nix/profiles/per-user/root/channels/nixpkgs: Operation not permitted
```

This happens, because `EvalSettings::getDefaultNixPath` tries to access
paths outside the sandbox. Since the state-dir is not required for
doc generation, it is set to the dummy folder. This needs to be done
for all nix invocations during doc generation, as
`EvalSettings::getDefaultNixPath` is called unconditionally.
@edolstra edolstra merged commit 605bacd into NixOS:master Nov 23, 2020
@edolstra
Copy link
Member

Thanks!

@B4dM4n B4dM4n deleted the macos-sandbox-build branch November 23, 2020 17:13
horriblename pushed a commit to horriblename/nmd that referenced this pull request Oct 4, 2023
See NixOS/nix#4276

Without this, Nix tries to stat channels in /nix/var/nix and fails.
This happens when determining the default value of the `nix-path`
option, so before we have a chance to override `nix-path` or set
`restrict-eval`; our only hope is to confine the looked-up paths to the
sandbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants