diff mbox series

go: install default go.env file

Message ID 20250228203206.1979714-2-danismostlikely@gmail.com
State New
Headers show
Series go: install default go.env file | expand

Commit Message

Dan McGregor Feb. 28, 2025, 8:32 p.m. UTC
From: Dan McGregor <dan.mcgregor@usask.ca>

The go tools require the GOPROXY and GOSUMDB environment variables
set when using modules on a target system. These aren't set by default
in the binaries, they require an environment file. Install the default
one in the target case. In our -native toolchain we always set these
values appropriately, so no need for it there.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
---
 meta/recipes-devtools/go/go-target.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index 981c7abd313..7e4139102e3 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -34,6 +34,7 @@  do_install() {
 	cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
 	install -d ${D}${libdir}/go/src
 	cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
+	cp --preserve=mode,timestamps ${S}/go.env ${D}${libdir}/go/
 	find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
 	install -d ${D}${libdir}/go/bin
 	install -d ${D}${bindir}
@@ -46,7 +47,7 @@  do_install() {
 }
 
 PACKAGES = "${PN} ${PN}-dev"
-FILES:${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}"
+FILES:${PN} = "${libdir}/go/bin ${libdir}/go/go.env ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}"
 RDEPENDS:${PN} = "go-runtime"
 INSANE_SKIP:${PN} = "ldflags"