From c0a02a453da8aa6592e8d319eafe93d735bba0a0 Mon Sep 17 00:00:00 2001 From: Andy <119136210+AndyMik90@users.noreply.github.com> Date: Fri, 26 Dec 2025 14:36:20 +0100 Subject: [PATCH] fix(build): use explicit Windows System32 tar path (#308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous PowerShell fix still found Git Bash's /usr/bin/tar which interprets D: as a remote host. Using the explicit path to Windows' built-in bsdtar (C:\Windows\System32\tar.exe) avoids this issue. Windows Server 2019+ (GitHub Actions) has bsdtar in System32. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 --- apps/frontend/scripts/download-python.cjs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/frontend/scripts/download-python.cjs b/apps/frontend/scripts/download-python.cjs index 122873cb..945911d6 100644 --- a/apps/frontend/scripts/download-python.cjs +++ b/apps/frontend/scripts/download-python.cjs @@ -257,16 +257,14 @@ function extractTarGz(archivePath, destDir) { const isWindows = os.platform() === 'win32'; - // On Windows, use PowerShell to extract tar.gz (most reliable cross-platform) - // This avoids all the path escaping issues with tar command + // On Windows, use Windows' built-in bsdtar (not Git Bash tar which has path issues) + // Git Bash's /usr/bin/tar interprets D: as a remote host, causing extraction to fail + // Windows Server 2019+ and Windows 10+ have bsdtar at C:\Windows\System32\tar.exe if (isWindows) { - // PowerShell can extract tar.gz natively on Windows 10+ - const psCommand = ` - $ErrorActionPreference = 'Stop' - tar -xzf "${archivePath}" -C "${destDir}" - `; + // Use explicit path to Windows tar to avoid Git Bash's /usr/bin/tar + const windowsTar = 'C:\\Windows\\System32\\tar.exe'; - const result = spawnSync('powershell', ['-NoProfile', '-Command', psCommand], { + const result = spawnSync(windowsTar, ['-xzf', archivePath, '-C', destDir], { stdio: 'inherit', }); @@ -275,7 +273,7 @@ function extractTarGz(archivePath, destDir) { } if (result.status !== 0) { - throw new Error(`Failed to extract archive: PowerShell exited with code ${result.status}`); + throw new Error(`Failed to extract archive: Windows tar exited with code ${result.status}`); } } else { // Unix: use tar directly