Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config File Support #5

Open
rickvanprim opened this issue Nov 23, 2023 · 1 comment
Open

Config File Support #5

rickvanprim opened this issue Nov 23, 2023 · 1 comment

Comments

@rickvanprim
Copy link

rickvanprim commented Nov 23, 2023

I'm trying to see if I can get bazelisk working in a Nix (container) environment for bazelbuild/continuous-integration#1799 and I'm running into an issue where Bazel (and many executables it launches) run fine with nix-ld-rs (it gets past the child process issue that nix-ld has) but in some cases Bazel insists on running a child process with a clean environment and hard-coded PATH.

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 for NIX_LD and NIX_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.

@Mic92
Copy link
Member

Mic92 commented Jun 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants