From 4a97cb1ea2aefcf823136db9d51a03aef7b1d2ed Mon Sep 17 00:00:00 2001 From: Jon Chery Date: Wed, 12 Aug 2026 21:37:01 +0000 Subject: [PATCH] =?UTF-8?q?fix(P1):=20set=20Go=20env=20vars=20in=20ci-run.?= =?UTF-8?q?sh=20=E2=80=94=20shell-isolated=20executor=20drops=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CoreCI's buildIsolatedEnv does NOT forward GOROOT, GOPATH, GOCACHE, GOMODCACHE (they're in the systemVars deny-list in pass_through.go). The shell-isolated executor's env only has PATH, HOME, LANG, TMPDIR, TERM, CI + CORECI_* + CI_* + job vars. Without GOMODCACHE/GOCACHE, Go commands fail (can't find module/build cache). Fix: re-derive them from the go binary on PATH via 'go env GOROOT' etc. ---ci--- project: orca phase: 1 milestone: v0.16 status: execute ---/ci--- --- scripts/ci-run.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/ci-run.sh b/scripts/ci-run.sh index 9c32a3a..92c1042 100755 --- a/scripts/ci-run.sh +++ b/scripts/ci-run.sh @@ -19,6 +19,17 @@ if [ -z "$JOB" ]; then exit 1 fi +# CoreCI's shell-isolated executor (buildIsolatedEnv) does NOT forward +# Go toolchain env vars (GOROOT, GOPATH, GOCACHE, GOMODCACHE are in the +# systemVars deny-list). Re-derive them from the `go` binary on PATH so +# Go commands work in the shell-isolated executor. +if command -v go >/dev/null 2>&1; then + export GOROOT="${GOROOT:-$(go env GOROOT)}" + export GOPATH="${GOPATH:-$(go env GOPATH)}" + export GOCACHE="${GOCACHE:-$(go env GOCACHE)}" + export GOMODCACHE="${GOMODCACHE:-$(go env GOMODCACHE)}" +fi + info() { echo "ci-run: $*"; } err() { echo "ci-run: error: $*" >&2; exit 1; }