fix(P1): set Go env vars in ci-run.sh — shell-isolated executor drops them
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---
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user