about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2024-06-23 20:24:58 -0300
committerGitHub <noreply@github.com>2024-06-23 20:24:58 -0300
commit2ae0ffc65d3399a4db539f6ca48f45787d60f55b (patch)
tree32c722f010c876c2fd6527e7e2a2c1e74d9d9d99 /pkgs/build-support
parentfcd58516bcdd0fdeef888b7ceffb1b360d9f1a7e (diff)
parent4caf9a61f94bd730bd178ec6f543b8972ee43552 (diff)
Merge pull request #320851 from tie/dotnet-cross
buildDotnetModule: convert makeWrapperArgs to an array
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh
index f9aba29a43555..a9701f2898b27 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh
+++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh
@@ -1,3 +1,12 @@
+# For compatibility, convert makeWrapperArgs to an array unless we are using
+# structured attributes. That is, we ensure that makeWrapperArgs is always an
+# array.
+# See https://github.com/NixOS/nixpkgs/blob/858f4db3048c5be3527e183470e93c1a72c5727c/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh#L1-L3
+# and https://github.com/NixOS/nixpkgs/pull/313005#issuecomment-2175482920
+if [[ -z $__structuredAttrs ]]; then
+    makeWrapperArgs=( ${makeWrapperArgs-} )
+fi
+
 # First argument is the executable you want to wrap,
 # the second is the destination for the wrapper.
 wrapDotnetProgram() {
@@ -17,10 +26,8 @@ dotnetFromEnv'
 
     if [[ -n $__structuredAttrs ]]; then
         local -r dotnetRuntimeDepsArray=( "${dotnetRuntimeDeps[@]}" )
-        local -r makeWrapperArgsArray=( "${makeWrapperArgs[@]}" )
     else
         local -r dotnetRuntimeDepsArray=($dotnetRuntimeDeps)
-        local -r makeWrapperArgsArray=($makeWrapperArgs)
     fi
 
     local dotnetRuntimeDepsFlags=()
@@ -49,7 +56,7 @@ dotnetFromEnv'
         "${dotnetRuntimeDepsFlags[@]}" \
         "${dotnetRootFlagsArray[@]}" \
         "${gappsWrapperArgs[@]}" \
-        "${makeWrapperArgsArray[@]}"
+        "${makeWrapperArgs[@]}"
 
     echo "installed wrapper to "$2""
 }