Skip to content

Commit

Permalink
Merge #264
Browse files Browse the repository at this point in the history
264: Revert to manual quoting to make sure env variables can be used as part of other env variables when prefixing r=zimbatm a=chvp



Co-authored-by: Charlotte Van Petegem <[email protected]>
  • Loading branch information
bors[bot] and chvp authored Jul 3, 2023
2 parents 3864857 + 32dd058 commit f9238ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let
else if valType == "eval" then
"export ${name}=${eval}"
else if valType == "prefix" then
''export ${name}=$(${pkgs.coreutils}/bin/realpath --canonicalize-missing ${escapeShellArg prefix})''${${name}+:''${${name}}}''
''export ${name}=$(${pkgs.coreutils}/bin/realpath --canonicalize-missing "${prefix}")''${${name}+:''${${name}}}''
else if valType == "unset" then
''unset ${name}''
else
Expand Down
16 changes: 16 additions & 0 deletions tests/extra/language.c.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@
# Has a C compiler
type -p clang
'';
# Test good LD_LIBRARY_PATH value
language-c-2 =
let
shell = devshell.mkShell {
imports = [ ../../extra/language/c.nix ];
devshell.name = "devshell-2";
language.c.libraries = [ pkgs.openssl ];
};
in
runTest "language-c-2" { } ''
# Load the devshell
source ${shell}/env.bash
# LD_LIBRARY_PATH is evaluated correctly
[[ ! "$LD_LIBRARY_PATH" =~ "DEVSHELL_DIR" ]]
'';
}

0 comments on commit f9238ec

Please sign in to comment.