From cce6955932c07a518d627a33292da17832eb0c3e Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 1 Sep 2026 16:20:27 +0000 Subject: [PATCH] test(upgrade): migration test resolves bash through the parent PATH A hardcoded /usr/bin:/bin child PATH breaks spawn('bash') on the Windows curated lane (spawn resolves against the CHILD env's PATH; no bash.exe lives there). Hermeticity is carried by HOME/GSTACK_* overrides, not PATH. Found by the cycle-2 review pass. Co-Authored-By: Claude Fable 5 --- test/gstack-upgrade-migration-v1_78_0_0.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/gstack-upgrade-migration-v1_78_0_0.test.ts b/test/gstack-upgrade-migration-v1_78_0_0.test.ts index d7bcb4904..f1ac280ee 100644 --- a/test/gstack-upgrade-migration-v1_78_0_0.test.ts +++ b/test/gstack-upgrade-migration-v1_78_0_0.test.ts @@ -44,7 +44,12 @@ afterAll(() => { function run(): { code: number; stdout: string; stderr: string } { const r = spawnSync('bash', [MIGRATION], { env: { - PATH: '/usr/bin:/bin', + // The parent PATH, not a hardcoded POSIX one: on Windows, spawn + // resolves `bash` against the CHILD env's PATH, and /usr/bin:/bin + // contains no bash.exe there (the exact hazard documented on + // codex-under-codex-detection's KNOWN_WINDOWS_INCOMPATIBLE entry). + // Hermeticity comes from HOME/GSTACK_* below, not from PATH. + PATH: process.env.PATH ?? '/usr/bin:/bin', HOME: tmpHome, GSTACK_INSTALL_DIR: installDir, GSTACK_HOME: gstackHome,