buildGoModule: access `ldflags` and `tags` `__structuredAttrs`-agnostically (#360037)

authored by Yueh-Shun Li and committed by GitHub 03ed65c5 4cb5a03c

+3 -3
+3 -3
pkgs/build-support/go/module.nix
··· 222 222 local cmd="$1" dir="$2" 223 223 224 224 declare -a flags 225 - flags+=(''${tags:+-tags=''${tags// /,}}) 226 - flags+=(''${ldflags:+-ldflags="$ldflags"}) 225 + flags+=(''${tags:+-tags=$(concatStringsSep "," tags)}) 226 + flags+=(''${ldflags:+-ldflags="''${ldflags[*]}"}) 227 227 flags+=("-p" "$NIX_BUILD_CORES") 228 228 if (( "''${NIX_DEBUG:-0}" >= 1 )); then 229 229 flags+=(-x) ··· 267 267 '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' 268 268 # normalize cross-compiled builds w.r.t. native builds 269 269 ( 270 - dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} 270 + dir=$GOPATH/bin/''${GOOS}_''${GOARCH} 271 271 if [[ -n "$(shopt -s nullglob; echo $dir/*)" ]]; then 272 272 mv $dir/* $dir/.. 273 273 fi