From cd95a33511b9d9de6f6885ec75e6f39608238b9d Mon Sep 17 00:00:00 2001 From: Patrick Gerber <pge@ik.me> Date: Sun, 4 Dec 2022 15:06:42 +0100 Subject: [PATCH] package/pkg-golang: use package go env for download step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently package secific go env is used only during package build step. Go vendering is done during the download step and it's sometimes required to specify package secific go env also for this step. For example, when importing custom go modules who are hosted on a private host, it’s required to set GOPRIVATE to avoid public sum checking. Of all the environment variables driving the behaviour of the go command [0], there is none that obviously have an impact on the behaviour of go-mod, unless they are explicitly listed as such [1], so it seems pretty safe to include the generic environment variables for the download step. [0] https://pkg.go.dev/cmd/go#hdr-Environment_variables [1] https://go.dev/ref/mod#environment-variables Signed-off-by: Patrick Gerber <pge@ik.me> [yann.morin.1998@free.fr: add [0] and [1] and corresponding blurb] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> --- package/pkg-golang.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk index 0b3dc3d32f..cdc67b32c0 100644 --- a/package/pkg-golang.mk +++ b/package/pkg-golang.mk @@ -87,7 +87,8 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD $(2)_DOWNLOAD_POST_PROCESS = go $(2)_DL_ENV += \ $$(HOST_GO_COMMON_ENV) \ - GOPROXY=direct + GOPROXY=direct \ + $$($(2)_GO_ENV) # Due to vendoring, it is pretty likely that not all licenses are # listed in <pkg>_LICENSE.