Allow building with Nix on Linux distros other than NixOS (#31001)

* remove NixOS check from mach wrapper

* pin nixpkgs to fix jemalloc-sys + mozangle build scripts

* add stdenv.cc.cc to LD_LIBRARY_PATH to fix webrender build.rs

* add all buildInputs to LD_LIBRARY_PATH to fix ldd servo

* add glib + zlib to buildInputs to fix ldd servo

* working! patchelf --remove-rpath --set-interpreter

* undo changes that were ultimately unhelpful

* make compiled programs independent of Nix

* avoid installing patchelf’d toolchains in ~/.rustup

* remove another spurious change

* fix rustup pollution

* only enable on other distros when MACH_USE_NIX is set
This commit is contained in:
Delan Azabani 2024-01-09 18:29:25 +08:00 committed by GitHub
parent 6a804cd775
commit 94a3c49a80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 6 deletions

3
mach
View file

@ -31,7 +31,8 @@ def main(args):
if __name__ == '__main__':
sys.dont_write_bytecode = True
if os.path.exists('/etc/NIXOS') and not 'IN_NIX_SHELL' in os.environ: # we're on a nixOS system, need to run mach in nix-shell
need_nix_shell = os.path.exists('/etc/NIXOS') or 'MACH_USE_NIX' in os.environ
if need_nix_shell and not 'IN_NIX_SHELL' in os.environ:
import subprocess
from shlex import quote
mach_dir = os.path.abspath(os.path.dirname(__file__))