-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Closed
Labels
0.kind: bugSomething is brokenSomething is broken1.severity: significantNovel ideas, large API changes, notable refactorings, issues with RFC potential, etc.Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc.
Description
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:
nixpkgs/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
Lines 17 to 26 in 0855890
| # 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 hereAdd a 👍 reaction to issues you find important.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken1.severity: significantNovel ideas, large API changes, notable refactorings, issues with RFC potential, etc.Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc.