Skip to content

Commit 42d8d90

Browse files
authored
fix: add NIX_LDs vars to work on NixOS (#3304)
Re-implements #3223 (special thanks to @tkr-sh!) > No bazel command will work on NixOS when using crate_universe because `NIX_LD` is removed by `.env_clear()`. See <https://github.com/nix-community/nix-ld> This fix is fairly simple, and makes the command work on NixOS. closes #3224
1 parent a88b489 commit 42d8d90

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crate_universe/src/lockfile.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ impl Digest {
163163
OsStr::new("HOME"),
164164
OsStr::new("HOMEDRIVE"),
165165
OsStr::new("PATHEXT"),
166+
OsStr::new("NIX_LD"),
167+
OsStr::new("NIX_LD_LIBRARY_PATH"),
166168
];
167169
let env = std::env::vars_os().filter(|(var, _)| safe_vars.contains(&var.as_os_str()));
168170

0 commit comments

Comments
 (0)