Skip to content

ci: fix Go cache perms in mx-sdk container#171

Merged
webern merged 1 commit into
musicxml-4.0from
musicxml-4.0-ci-fix
Jun 14, 2026
Merged

ci: fix Go cache perms in mx-sdk container#171
webern merged 1 commit into
musicxml-4.0from
musicxml-4.0-ci-fix

Conversation

@webern

@webern webern commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Problem

The Linux (Go + C targets) CI job fails at the Go corert suite step
(run):

cd gen/test/go && MX_REPO_ROOT=/workspace go test -count=1 -v ./corert/
go: go: could not create module cache: mkdir /go: permission denied
make: *** [Makefile:355: test-go] Error 1

The DOCKER_RUN recipe runs the mx-sdk container as the caller's uid:gid
(--user 1001:1001 on the runner). That UID has no /etc/passwd entry, so
HOME defaults to /. Go then derives GOPATH=/go and
GOCACHE=/.cache/go-build, neither of which the unprivileged user can create.

The C++ jobs don't hit this because the Dockerfile already pins CCACHE_DIR
to the writable /workspace/build volume; Go had no equivalent override.

Fix

Pin GOPATH, GOCACHE, and GOMODCACHE under the writable /workspace/build
volume in the Dockerfile, exactly mirroring CCACHE_DIR. The Go module is
vendored (gen/test/go/vendor/), so no network fetch is needed.

Base

Targets musicxml-4.0 so that merging this folds the fix into PR #169.

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.
@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit ccc0507e7edc67e9d9fa7e76297f3f831443802a.

@github-actions

Copy link
Copy Markdown

Coverage report

Core-dev coverage src/private/mx/core/

Metric Coverage Covered / Total
Lines 77.9% 28505 / 36590
Functions 74.4% 6354 / 8542
Branches 50.7% 22645 / 44673

API coverage src/private/mx/{api,impl,utility}/

Metric Coverage Covered / Total
Lines 68.7% 4734 / 6895
Functions 53.5% 1507 / 2816
Branches 40.3% 3851 / 9562

Core HTML report | API HTML report

Commit ccc0507e7edc67e9d9fa7e76297f3f831443802a.

@webern webern merged commit 76e7707 into musicxml-4.0 Jun 14, 2026
5 of 6 checks passed
@webern webern deleted the musicxml-4.0-ci-fix branch June 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant