Describe the bug
Having a '?' character in a wrapProgram --prefix value causes that value to be ignored.
Steps To Reproduce
- Build this derivation:
{ stdenv, makeWrapper }:
stdenv.mkDerivation {
name = "bug-example";
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cat <<EOF > $out/bin/bug
#!/bin/sh
echo "TESTVAR1 = \$TESTVAR1"
echo "TESTVAR2 = \$TESTVAR2"
echo "TESTVAR3 = \$TESTVAR3"
EOF
chmod a+x $out/bin/bug
wrapProgram $out/bin/bug \
--prefix TESTVAR1 ':' 'aaa:bbb' \
--prefix TESTVAR2 ':' 'aa?:bbb' \
--prefix TESTVAR3 ':' 'aaa:bb?'
runHook postInstall
'';
}
- Run
./result/bin/bug
Expected behavior
A clear and concise description of what you expected to happen.
Expected:
$ ./result/bin/bug
TESTVAR1 = aaa:bbb
TESTVAR2 = aa?:bbb
TESTVAR3 = aaa:bb?
Actual:
$ ./result/bin/bug
TESTVAR1 = aaa:bbb
TESTVAR2 = bbb
TESTVAR3 = aaa
Additional context
This is causing problems with Lua packages, specifically when using wrapProgram to set LUA_PATH and LUA_CPATH, as
these often have ? in then, e.g. /nix/store/cqmn2sbmp0j3h2b2bcgb21ys3gqjxnva-lua-5.2.4-env/lib/lua/5.2/?.so
Notify maintainers
@talyz @alyssais
Sorry if wrong people, am using git blame.
Metadata
$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.10.101, NixOS, 22.05 (Quokka)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.6.1`
- channels(zane): `""`
- channels(root): `"nixos-22.05pre356180.d5f23787297, nixos-unstable-22.05pre356180.d5f23787297"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Describe the bug
Having a '?' character in a
wrapProgram --prefixvalue causes that value to be ignored.Steps To Reproduce
./result/bin/bugExpected behavior
A clear and concise description of what you expected to happen.
Expected:
Actual:
Additional context
This is causing problems with Lua packages, specifically when using
wrapProgramto setLUA_PATHandLUA_CPATH, asthese often have
?in then, e.g./nix/store/cqmn2sbmp0j3h2b2bcgb21ys3gqjxnva-lua-5.2.4-env/lib/lua/5.2/?.soNotify maintainers
@talyz @alyssais
Sorry if wrong people, am using
git blame.Metadata