Skip to content

Commit a83e84c

Browse files
committed
test(setup-matrix): give each case its own home directory
run-case.sh isolated only XDG_CACHE_HOME, so every package manager it drives resolved its cache, store and credentials from the caller's real home. Under `setup-matrix.sh run --host` that is the developer's own home directory. Each case now gets HOME inside its per-case WORKDIR, along with the variables that outrank HOME for their tools (CARGO_HOME, GOPATH, GOMODCACHE, GOCACHE, PNPM_HOME, COREPACK_HOME, NUGET_PACKAGES and the remaining XDG dirs). The verification helpers read through those same variables, so they keep resolving without changes.
1 parent 53aa893 commit a83e84c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/setup_matrix/run-case.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,16 @@ export SOCKET_TELEMETRY_DISABLED=1 SOCKET_EXPERIMENTAL_MAVEN=1 SOCKET_EXPERIMENT
664664
# Isolate the pypi `.pth` hook's change-detection stamp per case so runs
665665
# don't bleed into each other (the stamp lives under XDG_CACHE_HOME).
666666
export XDG_CACHE_HOME="$WORKDIR/.cache"
667+
# Give the case its own home so every package manager's cache, store and
668+
# credentials stay inside WORKDIR. Under `--host` these run on the
669+
# developer's machine, where the default is their real home. The vars
670+
# below outrank HOME for their tools, so they are pointed inside it
671+
# rather than left to leak.
672+
mkdir -p "$WORKDIR/home"
673+
export HOME="$WORKDIR/home"
674+
export XDG_DATA_HOME="$WORKDIR/home/.local/share" XDG_CONFIG_HOME="$WORKDIR/home/.config" XDG_STATE_HOME="$WORKDIR/home/.local/state"
675+
export CARGO_HOME="$WORKDIR/home/.cargo" GOPATH="$WORKDIR/home/go" GOMODCACHE="$WORKDIR/home/go/pkg/mod" GOCACHE="$WORKDIR/home/.cache/go-build"
676+
export PNPM_HOME="$WORKDIR/home/.pnpm" COREPACK_HOME="$WORKDIR/home/.corepack" NUGET_PACKAGES="$WORKDIR/home/.nuget/packages"
667677
# NOTE: deliberately do NOT export SOCKET_CWD. The install hook's apply
668678
# must run with whatever cwd the package manager sets for the lifecycle
669679
# script — the project root for a single project, and the *member* dir

0 commit comments

Comments
 (0)