From adad881449a743d8d275ba4dc58f4fbab0656c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Kerekes?= Date: Fri, 23 Oct 2026 05:19:59 +0200 Subject: [PATCH] fix(release): smoke Windows archives with the system tar --- scripts/smoke-release.mjs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/smoke-release.mjs b/scripts/smoke-release.mjs index 0416a7a..0dffdf6 100644 --- a/scripts/smoke-release.mjs +++ b/scripts/smoke-release.mjs @@ -36,12 +36,11 @@ let output = ""; let failure = ""; let ready = false; try { - await exec(windows ? "tar.exe" : "tar", [ - windows ? "-xf" : "-xzf", - join(directory, archive), - "-C", - temporary, - ]); + // A PATH lookup on Windows can find GNU tar, which cannot read zip archives or drive paths. + await exec( + windows ? join(process.env.SystemRoot ?? "C:\\Windows", "System32", "tar.exe") : "tar", + [windows ? "-xf" : "-xzf", join(directory, archive), "-C", temporary], + ); const bundle = join(temporary, "inbot"); assert.equal( await readFile(join(bundle, "LICENSE"), "utf8"), @@ -61,7 +60,9 @@ try { ); const launcher = join(bundle, windows ? "inbot.cmd" : "inbot"); const home = join(temporary, "home"); - const helpEnv = { ...bundledEnv, INBOT_HOME: home, INBOT_TEST_SHIM: launcher }; + // PowerShell 7 exports its own module path, which stops Windows PowerShell from loading its cmdlets. + const { PSModulePath: _, ...shellEnv } = bundledEnv; + const helpEnv = { ...shellEnv, INBOT_HOME: home, INBOT_TEST_SHIM: launcher }; const help = windows ? await exec( "powershell.exe",