From 7e4c3715a2ffbf36e809cbd2995ce2f71b478ec1 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 28 May 2023 11:44:54 +1000 Subject: [PATCH 1/2] buildGoPackage: remove `ldflags` and `with builtins` as done for buildGoModule in abd5dfa01396942cf65cea34829e448ed4263950 and 3be02ada9e31503a779b5f79320ca80d5e8aee8c --- pkgs/build-support/go/package.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/build-support/go/package.nix b/pkgs/build-support/go/package.nix index 9dd1cf151294b..f9e6c14ab2716 100644 --- a/pkgs/build-support/go/package.nix +++ b/pkgs/build-support/go/package.nix @@ -7,9 +7,6 @@ , preFixup ? "" , shellHook ? "" -# Go linker flags, passed to go via -ldflags -, ldflags ? [] - # Go tags, passed to go via -tag , tags ? [] @@ -49,9 +46,6 @@ , meta ? {}, ... } @ args: - -with builtins; - let dep2src = goDep: { From 2ad8ddd904dfbfa4c517fa695fe3d69141a290bd Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 26 May 2023 00:21:04 +0800 Subject: [PATCH 2/2] buildGo{Module,Package}: remove input argument "tags" Unify how ldflags and tags are passed --- pkgs/build-support/go/module.nix | 5 +---- pkgs/build-support/go/package.nix | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 2432ac3a49823..61abd040a46fb 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -6,9 +6,6 @@ , passthru ? { } , patches ? [ ] - # Go tags, passed to go via -tag -, tags ? [ ] - # A function to override the go-modules derivation , overrideModAttrs ? (_oldAttrs: { }) @@ -201,7 +198,7 @@ let declare -a flags flags+=($buildFlags "''${buildFlagsArray[@]}") - flags+=(''${tags:+-tags=${lib.concatStringsSep "," tags}}) + flags+=(''${tags:+-tags=''${tags// /,}}) flags+=(''${ldflags:+-ldflags="$ldflags"}) flags+=("-p" "$NIX_BUILD_CORES") diff --git a/pkgs/build-support/go/package.nix b/pkgs/build-support/go/package.nix index f9e6c14ab2716..b4cb264d9f242 100644 --- a/pkgs/build-support/go/package.nix +++ b/pkgs/build-support/go/package.nix @@ -7,9 +7,6 @@ , preFixup ? "" , shellHook ? "" -# Go tags, passed to go via -tag -, tags ? [] - # We want parallel builds by default , enableParallelBuilding ? true @@ -166,7 +163,7 @@ let declare -a flags flags+=($buildFlags "''${buildFlagsArray[@]}") - flags+=(''${tags:+-tags=${lib.concatStringsSep "," tags}}) + flags+=(''${tags:+-tags=''${tags// /,}}) flags+=(''${ldflags:+-ldflags="$ldflags"}) flags+=("-p" "$NIX_BUILD_CORES")