diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-05-03 19:03:51 +0200 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-05-03 19:03:51 +0200 |
commit | b4617eb071811bfcab3f5f0d640fc9cd633d754b (patch) | |
tree | 1e63d85a38569abd4b2dc7e8bac320752719ef82 /pkgs/build-support | |
parent | f3ff1f7e2b03b4af2874924d267fc1038c5f1dac (diff) | |
parent | 7c4cc6476bd485d2e62418dc3cde25e1c579d7d2 (diff) |
Merge branch 'staging-next' into staging
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/go/module.nix | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 09969338ac1d2..bc28fbf6fc420 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -163,8 +163,10 @@ let inherit (go) GOOS GOARCH; GOFLAGS = GOFLAGS - ++ lib.optional (!proxyVendor) "-mod=vendor" - ++ lib.optional (!allowGoReference) "-trimpath"; + ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" + (lib.optional (!proxyVendor) "-mod=vendor") + ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + (lib.optional (!allowGoReference) "-trimpath"); inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN; # If not set to an explicit value, set the buildid empty for reproducibility. @@ -196,7 +198,12 @@ let runHook postConfigure ''); - buildPhase = args.buildPhase or ('' + buildPhase = args.buildPhase or ( + lib.warnIf (buildFlags != "" || buildFlagsArray != "") + "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`" + lib.warnIf (builtins.elem "-buildid=" ldflags) + "`-buildid=` is set by default as ldflag by buildGoModule" + '' runHook preBuild exclude='\(/_\|examples\|Godeps\|testdata' @@ -313,9 +320,4 @@ let } // meta; }); in -lib.warnIf (buildFlags != "" || buildFlagsArray != "") - "`buildFlags`/`buildFlagsArray` are deprecated and will be removed in the 24.11 release. Use the `ldflags` and/or `tags` attributes instead" -lib.warnIf (builtins.elem "-buildid=" ldflags) "`-buildid=` is set by default as ldflag by buildGoModule" -lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" -lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" - package +package |