mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/go: set GOCACHE for download post-process
The go mod vendor call in support/download/go-post-process accesses the go cache, so pass GOCACHE= in the environment to ensure our cache directory is used. The go cache defaults to ~/.cache/go-build if not set, so this fixes builds where that location (or GOCACHE if set in the environment) is not writable: rm -rf ~/.cache/go-build chmod -w ~/.cache make docker-compose-source .. failed to initialize build cache at /home/peko/.cache/go-build: mkdir /home/peko/.cache/go-build: permission denied make[1]: *** [package/pkg-generic.mk:189: /home/peko/source/buildroot/output/build/docker-compose-2.14.0/.stamp_downloaded] Error 1 We use two different cache directories for target and host builds, but the download/vendoring should be independent of the architecture, so use the target variant even for host-only packages for simplicity. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
aac8ce4999
commit
07a745e55d
@@ -25,6 +25,7 @@ HOST_GO_COMMON_ENV = \
|
|||||||
GOFLAGS=-mod=vendor \
|
GOFLAGS=-mod=vendor \
|
||||||
GOROOT="$(HOST_GO_ROOT)" \
|
GOROOT="$(HOST_GO_ROOT)" \
|
||||||
GOPATH="$(HOST_GO_GOPATH)" \
|
GOPATH="$(HOST_GO_GOPATH)" \
|
||||||
|
GOCACHE="$(HOST_GO_TARGET_CACHE)" \
|
||||||
GOPROXY=off \
|
GOPROXY=off \
|
||||||
PATH=$(BR_PATH) \
|
PATH=$(BR_PATH) \
|
||||||
GOBIN= \
|
GOBIN= \
|
||||||
@@ -75,7 +76,6 @@ HOST_GO_TARGET_ENV = \
|
|||||||
$(HOST_GO_COMMON_ENV) \
|
$(HOST_GO_COMMON_ENV) \
|
||||||
GOOS="linux" \
|
GOOS="linux" \
|
||||||
GOARCH=$(GO_GOARCH) \
|
GOARCH=$(GO_GOARCH) \
|
||||||
GOCACHE="$(HOST_GO_TARGET_CACHE)" \
|
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" \
|
||||||
CXX="$(TARGET_CXX)" \
|
CXX="$(TARGET_CXX)" \
|
||||||
CGO_CFLAGS="$(TARGET_CFLAGS)" \
|
CGO_CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
|||||||
Reference in New Issue
Block a user