mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 20:03:24 +00:00
buildGo{Module,Package}: set GOTOOLCHAIN to local
prevent go from downloading another toolchain
This commit is contained in:
parent
41ccfa322e
commit
86cd7e0948
@ -53,6 +53,7 @@ let
|
||||
args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ];
|
||||
|
||||
GO111MODULE = "on";
|
||||
GOTOOLCHAIN = "local";
|
||||
|
||||
goModules = if (vendorHash == null) then "" else
|
||||
(stdenv.mkDerivation {
|
||||
@ -62,7 +63,7 @@ let
|
||||
|
||||
inherit (args) src;
|
||||
inherit (go) GOOS GOARCH;
|
||||
inherit GO111MODULE;
|
||||
inherit GO111MODULE GOTOOLCHAIN;
|
||||
|
||||
# The following inheritence behavior is not trivial to expect, and some may
|
||||
# argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and
|
||||
@ -151,7 +152,7 @@ let
|
||||
inherit (go) GOOS GOARCH;
|
||||
|
||||
GOFLAGS = lib.optionals (!proxyVendor) [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ];
|
||||
inherit CGO_ENABLED enableParallelBuilding GO111MODULE;
|
||||
inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN;
|
||||
|
||||
configurePhase = args.configurePhase or (''
|
||||
runHook preConfigure
|
||||
|
@ -86,6 +86,7 @@ let
|
||||
inherit CGO_ENABLED enableParallelBuilding;
|
||||
|
||||
GO111MODULE = "off";
|
||||
GOTOOLCHAIN = "local";
|
||||
GOFLAGS = lib.optionals (!allowGoReference) [ "-trimpath" ];
|
||||
|
||||
GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
|
||||
|
Loading…
Reference in New Issue
Block a user