Open rickvanprim opened 9 months ago
I didn't added a configuration file in nix-ld, because it was a bit of a pain to achieve this without libc. In nix-ld-rs this should be easier now. However should only support system or user level configuration and not look up files in projects i.e. .nix-ld.conf
. The latter one is a security risk as it allows code execution - except if we would allow to define safe prefixes like git or gdb does.
I'm trying to see if I can get
bazelisk
working in a Nix (container) environment for https://github.com/bazelbuild/continuous-integration/pull/1799 and I'm running into an issue where Bazel (and many executables it launches) run fine withnix-ld-rs
(it gets past the child process issue thatnix-ld
has) but in some cases Bazel insists on running a child process with a clean environment and hard-codedPATH
.I think the nixpkgs version of Bazel patches out this behavior, if I'm interpreting this correctly (https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/bazel/nix-hacks.patch). If
nix-ld-rs
could fall back to reading/etc/nix-ld.conf
(for example) to get the values forNIX_LD
andNIX_LD_LIBRARY_PATH
, that would work around this particular case.I'm assuming not having config file support is a pretty deliberate choice for a reason I'm not considering. If not and this functionality would be a good addition, I'd be happy to take a stab at a PR.