On macOS 12, the system has dyld shared caches in /System/Library/dyld/, but Nix's macOS sandbox does not allow access to this location. This produces sandbox deny warnings in the Console and presumably incurs a performance penalty.
Nix should just add /System/Library/dyld/ to the set of default paths it allows reading from in the sandbox.. This only contains shared caches (dyld shared cache and something called "aot_shared_cache"), and in general everything on macOS uses dyld so we should not restrict access to dyld's expected resources.
Steps To Reproduce
In one terminal window, run log stream --predicate 'message CONTAINS "dyld_shared_cache"'
In another terminal window, run nix --sandbox build --impure --expr 'with import <nixpkgs> {}; runCommandNoCC "foo" {} "echo hi"'
In the first terminal window, it will print something like
Describe the bug
On macOS 12, the system has dyld shared caches in
/System/Library/dyld/
, but Nix's macOS sandbox does not allow access to this location. This produces sandbox deny warnings in the Console and presumably incurs a performance penalty.Nix should just add
/System/Library/dyld/
to the set of default paths it allows reading from in the sandbox.. This only contains shared caches (dyld shared cache and something called "aot_shared_cache"), and in general everything on macOS uses dyld so we should not restrict access to dyld's expected resources.Steps To Reproduce
log stream --predicate 'message CONTAINS "dyld_shared_cache"'
nix --sandbox build --impure --expr 'with import <nixpkgs> {}; runCommandNoCC "foo" {} "echo hi"'
In the first terminal window, it will print something like
This does not affect the build results (the reproduction command will fail since it never creates
$out
but builds in general work as expected).Expected behavior
These sandbox violations should not occur.
nix --version
outputnix (Nix) 2.5.1