From 1cd7d041504854789a5da6f1df7ba8b84d8fbcd9 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 23 Oct 2025 19:58:16 +0200 Subject: [PATCH] Use tar for extracting the uv zip file on Windows too Use extractTar() instead of extractZip() which is very slow for some reason (0.3s vs 10s) Fixes #659 --- dist/setup/index.js | 6 +----- src/download/download-version.ts | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 4a555e0..df05871 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -129171,7 +129171,6 @@ exports.tryGetFromToolCache = tryGetFromToolCache; exports.downloadVersionFromGithub = downloadVersionFromGithub; exports.downloadVersionFromManifest = downloadVersionFromManifest; exports.resolveVersion = resolveVersion; -const node_fs_1 = __nccwpck_require__(73024); const path = __importStar(__nccwpck_require__(76760)); const core = __importStar(__nccwpck_require__(37484)); const tc = __importStar(__nccwpck_require__(33472)); @@ -129211,12 +129210,9 @@ async function downloadVersion(downloadUrl, artifactName, platform, arch, versio const downloadPath = await tc.downloadTool(downloadUrl, undefined, githubToken); await (0, checksum_1.validateChecksum)(checkSum, downloadPath, arch, platform, version); let uvDir; - const extension = getExtension(platform); if (platform === "pc-windows-msvc") { - const fullPathWithExtension = `${downloadPath}${extension}`; - await node_fs_1.promises.copyFile(downloadPath, fullPathWithExtension); - uvDir = await tc.extractZip(fullPathWithExtension); // On windows extracting the zip does not create an intermediate directory + uvDir = await tc.extractTar(downloadPath, undefined, "x"); } else { const extractedDir = await tc.extractTar(downloadPath); diff --git a/src/download/download-version.ts b/src/download/download-version.ts index 3e7096c..5a9f207 100644 --- a/src/download/download-version.ts +++ b/src/download/download-version.ts @@ -108,12 +108,9 @@ async function downloadVersion( await validateChecksum(checkSum, downloadPath, arch, platform, version); let uvDir: string; - const extension = getExtension(platform); if (platform === "pc-windows-msvc") { - const fullPathWithExtension = `${downloadPath}${extension}`; - await fs.copyFile(downloadPath, fullPathWithExtension); - uvDir = await tc.extractZip(fullPathWithExtension); // On windows extracting the zip does not create an intermediate directory + uvDir = await tc.extractTar(downloadPath, undefined, "x"); } else { const extractedDir = await tc.extractTar(downloadPath); uvDir = path.join(extractedDir, artifactName);