]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
go.bbclass: disable workspaces
authorPeter Bergin <peter@berginkonsult.se>
Thu, 18 Dec 2025 10:46:34 +0000 (11:46 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 22 Dec 2025 17:54:58 +0000 (17:54 +0000)
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>
meta/classes-recipe/go.bbclass

index c323d4c9c933a8c903f3a8cc9695c51ab1a93cfd..b540471ba2d579e4fb971625eb35ac255df94035 100644 (file)
@@ -24,6 +24,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}"