[kirkstone,26/34] go.bbclass: disable the use of the default configuration file

Message ID 00f794aeaaa660851f3a8464ee89c553195dd3dd.1651246310.git.steve@sakoman.com
State Accepted, archived
Commit 00f794aeaaa660851f3a8464ee89c553195dd3dd
Headers show
Series [kirkstone,01/34] e2fsprogs: fix CVE-2022-1304 | expand

Commit Message

Steve Sakoman April 29, 2022, 4 p.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

We need to disable the use the default configuration file. This is
to ensure that user settings do not mess things up when building go
recipes.

For example, if I set 'GOBIN=./relative/path' in $HOME/.config/go/env,
then go-runtime fails to build with error like below:

  cannot install, GOBIN must be an absolute path

According to `go help environment',
"""
Setting GOENV=off in the environment disables the use of the default
configuration file.
"""

We can explicitly disable the configuration file by setting GOENV to off.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 711b41744ab08ee62c71cdccca335a7828ec0ba1)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/go.bbclass | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 9c4c92bffd..f3d83febbf 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -67,6 +67,7 @@  GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
+export GOENV = "off"
 export GOTMPDIR ?= "${WORKDIR}/build-tmp"
 GOTMPDIR[vardepvalue] = ""