Describe the bug
The cmakeFlags array cannot parse spaces correctly, and thinks any argument after a space is a another CMake flag. I think it splits the flag on spaces upon parsing it. The flags do get printed out correctly, however they are not handled the same way.
I've tried using all kinds of different quotes, and escaping almost every single character, but nothing seemed to work.
To Reproduce
Steps to reproduce the behavior:
- Append an space to a CMake flag. (
cmakeFlags = [ "-DFoo=\"foo bar\"" ];)
- Watch the
cmakeConfigurePhase fail, as it thinks bar is an seperate flag, and it cannot find this local file.
CMake Error: The source directory "/build/source/build/bar"" does not exist.
Expected behavior
cmakeFlags should be correctly passed to CMake, and the build should succeed.
Additional context
Note that when manually setting cmakeFlagsArray, this does work.
preConfigure = ''
cmakeFlagsArray=(
$cmakeFlagsArray
"-DFoo=\"foo bar\""
)
'';
When applying this flag from a nix-shell, it also succesfully parses it.
Notify maintainers
@ttuegel @LnL7
Metadata
- system:
"x86_64-linux"
- host os:
Linux 5.11.0, NixOS, 21.05pre271444.9816b99e71c (Okapi)
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.3.10
- channels(root):
"nixos-21.05pre271444.9816b99e71c"
- channels(ivv):
"home-manager, nixpkgs-21.05pre271900.11cd34cd592"
- nixpkgs:
/home/ivv/.nix-defexpr/channels/nixpkgs
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: cmake
attribute: yuzu-{mainline,ea}
Describe the bug
The
cmakeFlagsarray cannot parse spaces correctly, and thinks any argument after a space is a another CMake flag. I think it splits the flag on spaces upon parsing it. The flags do get printed out correctly, however they are not handled the same way.I've tried using all kinds of different quotes, and escaping almost every single character, but nothing seemed to work.
To Reproduce
Steps to reproduce the behavior:
cmakeFlags = [ "-DFoo=\"foo bar\"" ];)cmakeConfigurePhasefail, as it thinksbaris an seperate flag, and it cannot find this local file.CMake Error: The source directory "/build/source/build/bar"" does not exist.Expected behavior
cmakeFlagsshould be correctly passed to CMake, and the build should succeed.Additional context
Note that when manually setting
cmakeFlagsArray, this does work.When applying this flag from a nix-shell, it also succesfully parses it.
Notify maintainers
@ttuegel @LnL7
Metadata
"x86_64-linux"Linux 5.11.0, NixOS, 21.05pre271444.9816b99e71c (Okapi)yesyesnix-env (Nix) 2.3.10"nixos-21.05pre271444.9816b99e71c""home-manager, nixpkgs-21.05pre271900.11cd34cd592"/home/ivv/.nix-defexpr/channels/nixpkgsMaintainer information: