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