Skip to contentSkip to conversation

package/go: set GOCACHE to a host path

PATCH New Christian Stewart 3 participants 3 messages Mar 12, 2019 – Mar 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/go: set GOCACHE to a host path

Set the GOCACHE environment variable properly.

It was previously unset, and defaults to $HOME/.cache/go-build.

---
 package/go/go.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/go/go.mk +4 -0
index 1558b55e21..4daa2fe093 100644
@@ -37,13 +37,16 @@ GO_GOARCH = mips64le
 endif
 
 HOST_GO_DEPENDENCIES = host-go-bootstrap
+HOST_GO_HOST_CACHE = $(HOST_DIR)/usr/share/host-go-cache
 HOST_GO_ROOT = $(HOST_DIR)/lib/go
+HOST_GO_TARGET_CACHE = $(HOST_DIR)/usr/share/go-cache
 
 # For the convienience of target packages.
 HOST_GO_TOOLDIR = $(HOST_GO_ROOT)/pkg/tool/linux_$(GO_GOARCH)
 HOST_GO_TARGET_ENV = \
 	GO111MODULE=off \
 	GOARCH=$(GO_GOARCH) \
+	GOCACHE="$(HOST_GO_TARGET_CACHE)" \
 	GOROOT="$(HOST_GO_ROOT)" \
 	CC="$(TARGET_CC)" \
 	CXX="$(TARGET_CXX)" \
@@ -63,6 +66,7 @@ endif
 # HOSTCC_NOCCACHE.  See https://github.com/golang/go/issues/11685.
 HOST_GO_MAKE_ENV = \
 	GO111MODULE=off \
+	GOCACHE=$(HOST_GO_HOST_CACHE) \
 	GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_ROOT) \
 	GOROOT_FINAL=$(HOST_GO_ROOT) \
 	GOROOT="$(@D)" \
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 package/go: set GOCACHE to a host path

Quoted 8 lines · On Mon, 11 Mar 2019 22:41:14 -0700 Christian Stewart <[email protected]> wrote:

Set the GOCACHE environment variable properly.

It was previously unset, and defaults to $HOME/.cache/go-build.

---
 package/go/go.mk | 4 ++++
 1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/go: set GOCACHE to a host path

In reply to Christian Stewart
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart <[email protected]> writes:

Set the GOCACHE environment variable properly.
It was previously unset, and defaults to $HOME/.cache/go-build.

Committed to 2018.11.x and 2019.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard