]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
go.bbclass: disable the use of the default configuration file
authorChen Qi <Qi.Chen@windriver.com>
Tue, 26 Apr 2022 03:59:09 +0000 (11:59 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Apr 2022 17:29:04 +0000 (18:29 +0100)
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>
meta/classes/go.bbclass

index df8d4db26de455ff341d405106dde0a9b32a4e92..1a9a0bc1d4269c2b252b9fe2d0dbe2856017e8ac 100644 (file)
@@ -68,6 +68,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
+export GOENV = "off"
 export GOTMPDIR ?= "${WORKDIR}/build-tmp"
 GOTMPDIR[vardepvalue] = ""