Skip to content

Commit 6382fad

Browse files
committed
fix(ci): give the wrapper smoke a Go toolchain and a deletable work tree
The v0.12.1 release smoke failed on every leg in Phase 13w, the package-wrapper install gate added in #2664: - macOS: the runner images have no Go on PATH, and SMOKE_REQUIRE_WRAPPERS=1 rightly fails without one. pr-smoke and the three release smoke jobs now set up Go from pkg/go/go.mod, with the same pinned step the wrapper test job uses. - Windows: `mkdir -m 700` changes the mode in a second step, which MSYS2 cannot do under the smoke profile's owner-only DACL. mktemp -d sets the mode at creation. - Linux: the runner's older Go downloaded the 1.26.1 toolchain into the smoke profile's HOME. Go writes its module cache read-only, so the harness could not delete its profile afterwards. All Go state now stays in the wrapper's own work tree, and its cleanup restores write permission before removing it. npm and PyPI passed on every leg that reached them; the gate itself is unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent e7ea0af commit 6382fad

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

‎.github/workflows/_smoke.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ jobs:
9595
steps:
9696
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9797

98+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
99+
# macOS runner images have none on PATH.
100+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
101+
with:
102+
go-version-file: pkg/go/go.mod
103+
cache: false
104+
98105
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
99106
with:
100107
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
@@ -176,6 +183,13 @@ jobs:
176183
steps:
177184
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
178185

186+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
187+
# MSYS2 shell below inherits it (path-type: inherit).
188+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
189+
with:
190+
go-version-file: pkg/go/go.mod
191+
cache: false
192+
179193
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
180194
with:
181195
msystem: ${{ matrix.arch == 'arm64' && 'CLANGARM64' || 'CLANG64' }}
@@ -281,6 +295,12 @@ jobs:
281295
steps:
282296
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
283297

298+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper.
299+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
300+
with:
301+
go-version-file: pkg/go/go.mod
302+
cache: false
303+
284304
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
285305
with:
286306
name: binaries-linux-${{ matrix.arch }}-portable

‎.github/workflows/pr.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ jobs:
190190
steps:
191191
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
192192

193+
# SMOKE_REQUIRE_WRAPPERS=1 needs a Go toolchain for the Go wrapper; the
194+
# macOS runner images have none on PATH.
195+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
196+
with:
197+
go-version-file: pkg/go/go.mod
198+
cache: false
199+
193200
- name: Install deps (Ubuntu)
194201
if: matrix.os == 'ubuntu-latest'
195202
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev ccache

‎scripts/smoke-wrappers.sh‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ REQUIRE="${SMOKE_REQUIRE_WRAPPERS:-0}"
2929
EXE=""
3030
case "${OSTYPE:-}" in msys* | cygwin* | win32*) EXE=".exe" ;; esac
3131

32-
WORK="${TMPDIR:-/tmp}/cbm-smoke-wrappers.$$.$RANDOM"
33-
mkdir -m 700 "$WORK"
34-
trap 'rm -rf "$WORK"' EXIT
32+
# mktemp -d sets 0700 at creation. `mkdir -m 700` changes the mode in a second
33+
# step, which MSYS2 cannot do under the smoke profile's owner-only DACL.
34+
WORK="$(mktemp -d "${TMPDIR:-/tmp}/cbm-smoke-wrappers.XXXXXX")"
35+
# Go writes its module cache read-only; restore write permission so it can be removed.
36+
trap 'chmod -R u+w "$WORK" 2>/dev/null; rm -rf "$WORK"' EXIT
3537
FAILED=0
3638

3739
missing() { # wrapper, what
@@ -127,7 +129,11 @@ smoke_go() {
127129
fi
128130
local dir="$WORK/go" rc=0
129131
mkdir -p "$dir"
132+
# All Go state stays under $WORK: a toolchain that GOTOOLCHAIN=auto downloads
133+
# lands read-only in the module cache, which must not end up in the caller's
134+
# HOME (the smoke harness could not delete its profile afterwards).
130135
(cd "$ROOT/pkg/go" && GOTOOLCHAIN="${GOTOOLCHAIN:-auto}" \
136+
GOPATH="$dir/gopath" GOMODCACHE="$dir/gomodcache" GOCACHE="$dir/gocache" \
131137
go build -o "$dir/codebase-memory-mcp$EXE" ./cmd/codebase-memory-mcp) \
132138
>"$dir/install.log" 2>&1 || rc=$?
133139
if [ "$rc" -ne 0 ]; then

0 commit comments

Comments
 (0)