Skip to content

Commit

Permalink
Merge pull request #302926 from helsinki-systems/fix/buildrustpackage…
Browse files Browse the repository at this point in the history
…-structuredattrs

cargoBuildHook: Fix features with __structuredAttrs
  • Loading branch information
Lassulus authored Apr 16, 2024
2 parents d3b241d + 6486868 commit 55205ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkgs/build-support/rust/hooks/cargo-build-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ cargoBuildHook() {
fi

if [ -n "${cargoBuildFeatures-}" ]; then
cargoBuildFeaturesFlag="--features=${cargoBuildFeatures// /,}"
if [ -n "$__structuredAttrs" ]; then
OLDIFS="$IFS"
IFS=','; cargoBuildFeaturesFlag="--features=${cargoBuildFeatures[*]}"
IFS="$OLDIFS"
unset OLDIFS
else
cargoBuildFeaturesFlag="--features=${cargoBuildFeatures// /,}"
fi
fi

(
Expand Down

0 comments on commit 55205ec

Please sign in to comment.