diff mbox series

[scarthgap,06/25] go.bbclass: disable workspaces

Message ID 9538bcefab6881805d60d9f362e0b70996b5e2f9.1780698373.git.yoann.congal@smile.fr
State New
Headers show
Series [scarthgap,01/25] cargo: set CVE_PRODUCT | expand

Commit Message

Yoann Congal June 5, 2026, 10:33 p.m. UTC
From: Peter Bergin <peter@berginkonsult.se>

go has a feature of workspaces [1]. If there is a file called go.work
in your working directory on any of its parent directories that will
be read and used during build. For OE where the builds shall
be sandboxed this is bad as a workspace file outside of the build
environment can be picked up. This commit wil disable that feature
according to the instruction in [1].

This was found and introduced build failures when a file go.work was
in the parent directory outside of OE build directory.

[1] https://go.dev/ref/mod#workspaces

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(From OE-Core rev: c52c5e88626968b08510818f09829f2e1c9f94ae)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/classes-recipe/go.bbclass | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass
index 61b08a082f7..36103e8eb0f 100644
--- a/meta/classes-recipe/go.bbclass
+++ b/meta/classes-recipe/go.bbclass
@@ -22,6 +22,7 @@  export GOARCH = "${TARGET_GOARCH}"
 export GOOS = "${TARGET_GOOS}"
 export GOHOSTARCH="${BUILD_GOARCH}"
 export GOHOSTOS="${BUILD_GOOS}"
+export GOWORK = "off"
 
 GOARM[export] = "0"
 GOARM:arm:class-target = "${TARGET_GOARM}"