about summary refs log tree commit diff
path: root/pkgs/build-support/rust/hooks/cargo-build-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/rust/hooks/cargo-build-hook.sh')
-rw-r--r--pkgs/build-support/rust/hooks/cargo-build-hook.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/hooks/cargo-build-hook.sh b/pkgs/build-support/rust/hooks/cargo-build-hook.sh
index ed982c7ff30a3..0ac9bf51a8334 100644
--- a/pkgs/build-support/rust/hooks/cargo-build-hook.sh
+++ b/pkgs/build-support/rust/hooks/cargo-build-hook.sh
@@ -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
 
     (