Skip to contentSkip to conversation

containerd: add -modcacherw to GO_BUILD_FLAGS

PATCH In review krant 2 participants 2 messages Oct 2 – Oct 4

lore
Share & tools
lore

krant

author
#0 lore raw

PATCH 1/1 containerd: add -modcacherw to GO_BUILD_FLAGS

From: Aleksey Vasilenko <[email protected]>

Because containerd overrides do_compile, it misses the standard -modcacherw flag from go-mod.bbclass. This leaves read-only files in the build directory, causing permission errors during cleanup tasks like rm_work.

Explicitly add the flag to GO_BUILD_FLAGS to fix this.

---
 recipes-containers/containerd/containerd_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/containerd/containerd_git.bb +1 -1
index 3d74cdd2..b1fb3115 100644
@@ -58,7 +58,7 @@ do_compile() {
     # cannot find package runtime/cgo (using -importcfg)
     #        ... recipe-sysroot-native/usr/lib/aarch64-poky-linux/go/pkg/tool/linux_amd64/link:
     #        cannot open file : open : no such file or directory
-    export GO_BUILD_FLAGS="-trimpath -a -pkgdir dontusecurrentpkgs"
+    export GO_BUILD_FLAGS="-trimpath -a -pkgdir dontusecurrentpkgs -modcacherw"
     # As of v2.2.0+ the GO11MODULE setting breaks the build (linking errors). It doesn't
     # seem necessary anymore. Leaving it here for now as a breakcrumb if other errors pop
     # up
Signature · 1 line
2.56.0