NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.06k stars 1.47k forks source link

Empty `sandbox-paths` in nix.conf is causing pkg builds to fail. #4861

Open apppppppple opened 3 years ago

apppppppple commented 3 years ago

Describe the bug About a week ago I was getting 'failed to allocate memory for gzip -d' when trying to run nixos-rebuild. I found a gh issue (can't find it anymore unfortunately) that suggested running it with --option extra-sandbox-paths "/bin/sh={bash path}" to fix the nix.conf file. I did that and while I am not getting oom errors anymore, building any packages from source fails with ninja: posix_spawn: no such file or directory. However if I build them with the extra-sandbox-paths option, they build fine. I checked /etc/nix/nix.conf and sure enough sandbox-paths is still empty. How can I change that? When I try to write to the file neovim says it's mounted to a readonly filesystem. I tried to edit it from my arch install but the file didn't seem to be there.

Steps To Reproduce

  1. Have an empty sandbox-paths
  2. Build a package from source (for me both wlroots with a custom src attribute and picom from the NUR worked for this) and observe that it fails.
  3. Build with --option [sandbox-paths/extra-sandbox-paths] "/bin/sh=..." and it should work.

nix-env --version output nix-env (Nix) 2.4pre20210503_6d2553a

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info