(cautiously) enable the sandbox by default on macOS #386
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#386
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the sandbox is disabled by default on macOS. However, to the best of our knowledge, it is not disabled for good reasons. That is to say, it is enabled on Hydra, and it is generally (with almost no exceptions) not tolerated to disable it in nixpkgs.
One exception, e.g.:
8fd4097529/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix (L1-L44)
I think that we could set it to
relaxed
for a release or two before defaulting to on.cc @puck
I would love to have a functioning sandbox on Darwin, but if we're talking about Hydra for nixpkgs, then I believe the sandbox is still flat out disabled there. At least according to the main Darwin maintainers:
Enabling it by default will require extensive work on nixpkgs or find a better compromise.
Pulling this from a conversation on Matrix:
I think one interesting approach (as suggested by nixpkgs darwin maintainers) could be making the default sandbox profile much more permissive. Basically just prevent picking up homebrew/system dependencies, prevent network access, etc. We could then introduce progressively stricter sandbox profiles that package maintainers could opt-in into.
This way we don't block Linux package maintainers that don't want to deal with darwin sandbox issues while still allowing darwin maintainers to improve reproducibility if they want to. Also this way we could have some sort of sandbox enabled on Hydra without having to fix thousands of packages.
Having a permissive sandbox is still preferable to no sandbox at all. We shouldn't let perfection get in the way of progress.
I wonder if
__darwinAllowLocalNetworking
could be extended to explicitly declare which ports the derivation needs. The Lix build scheduler could then reorder builds so no two derivations with the same resource requirements (ports) run at the same time.Edit: Tbh we could do this already without extending
__darwinAllowLocalNetworking
. It would just mean that any derivation tagged with__darwinAllowLocalNetworking
would be built sequentially. Which is reasonable as long as it excludes FOD.