Describe the bug
The cmake setup hook breaks with __structuredAttrs = true.
Steps To Reproduce
Write a derivation that uses cmake with __structuredAttrs = true and set cmakeFlags to a list with >1 element.
The build hook always treats $cmakeFlags as a normal variable, so it uses only the first array element.
Expected behavior
The flags get passed to cmake
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Solution used in the npm hook:
|
# Based on code from Python's buildPythonPackage wrap.sh script, for |
|
# supporting both the case when makeWrapperArgs is an array and a |
|
# IFS-separated string. |
|
# |
|
# TODO: remove the string branch when __structuredAttrs are used. |
|
if [[ "${makeWrapperArgs+defined}" == "defined" && "$(declare -p makeWrapperArgs)" =~ ^'declare -a makeWrapperArgs=' ]]; then |
|
local -a user_args=("${makeWrapperArgs[@]}") |
|
else |
|
local -a user_args="(${makeWrapperArgs:-})" |
|
fi |
Workaround: use cmakeFlagsArray instead.
Notify maintainers
@teto @ttuegel @LnL7 @AndersonTorres
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here
Add a 👍 reaction to issues you find important.
Describe the bug
The cmake setup hook breaks with
__structuredAttrs = true.Steps To Reproduce
Write a derivation that uses
cmakewith__structuredAttrs = trueand setcmakeFlagsto a list with >1 element.The build hook always treats
$cmakeFlagsas a normal variable, so it uses only the first array element.Expected behavior
The flags get passed to cmake
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Solution used in the npm hook:
nixpkgs/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
Lines 17 to 26 in 0855890
Workaround: use
cmakeFlagsArrayinstead.Notify maintainers
@teto @ttuegel @LnL7 @AndersonTorres
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"and paste the result.Add a 👍 reaction to issues you find important.