From 1a0e86df6357204c5ac1d7a54e1fc2735ff3217f Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sun, 14 Jun 2026 19:23:02 +0200 Subject: [PATCH] ci: fix Go cache perms in mx-sdk container The Linux (Go + C targets) job runs the container as the caller's uid:gid, which has no passwd entry, so HOME defaults to "/". Go then places GOPATH at /go and GOCACHE at /.cache/go-build, both unwritable, and `make test-go` dies with: could not create module cache: mkdir /go: permission denied Pin GOPATH/GOCACHE/GOMODCACHE under the writable build volume, mirroring CCACHE_DIR. The Go module is vendored, so no network fetch is required. --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index f39d5c40d..a56425722 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,4 +45,14 @@ ENV MX_RUNNING_IN_DOCKER=1 \ CCACHE_DIR=/workspace/build/.ccache \ CCACHE_MAXSIZE=2G +# The container runs as the caller's uid:gid (DOCKER_USER), which has no passwd +# entry, so HOME defaults to "/". Go would then place GOPATH at /go and GOCACHE +# at /.cache/go-build -- both unwritable -- and `make test-go` dies with +# "could not create module cache: mkdir /go: permission denied". Pin the Go +# caches under the writable build volume, exactly as CCACHE_DIR above. The Go +# module is vendored, so no network fetch is needed. +ENV GOPATH=/workspace/build/go \ + GOCACHE=/workspace/build/go/cache \ + GOMODCACHE=/workspace/build/go/pkg/mod + WORKDIR /workspace