From 74dd6f68172c892b749f6e2966a2540421db70eb Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 18 Jul 2022 09:12:07 +0000 Subject: [PATCH 1/2] Move zstd from flags to equivalent aliases --- packages/cache/src/internal/tar.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cache/src/internal/tar.ts b/packages/cache/src/internal/tar.ts index c8091919..1f63da51 100644 --- a/packages/cache/src/internal/tar.ts +++ b/packages/cache/src/internal/tar.ts @@ -67,9 +67,9 @@ export async function extractTar( function getCompressionProgram(): string[] { switch (compressionMethod) { case CompressionMethod.Zstd: - return ['--use-compress-program', 'zstd -d --long=30'] + return ['--use-compress-program', 'unzstd --long=30'] case CompressionMethod.ZstdWithoutLong: - return ['--use-compress-program', 'zstd -d'] + return ['--use-compress-program', 'unzstd'] default: return ['-z'] } @@ -106,9 +106,9 @@ export async function createTar( function getCompressionProgram(): string[] { switch (compressionMethod) { case CompressionMethod.Zstd: - return ['--use-compress-program', 'zstd -T0 --long=30'] + return ['--use-compress-program', 'zstdmt --long=30'] case CompressionMethod.ZstdWithoutLong: - return ['--use-compress-program', 'zstd -T0'] + return ['--use-compress-program', 'zstdmt'] default: return ['-z'] } @@ -140,9 +140,9 @@ export async function listTar( function getCompressionProgram(): string[] { switch (compressionMethod) { case CompressionMethod.Zstd: - return ['--use-compress-program', 'zstd -d --long=30'] + return ['--use-compress-program', 'unzstd --long=30'] case CompressionMethod.ZstdWithoutLong: - return ['--use-compress-program', 'zstd -d'] + return ['--use-compress-program', 'unzstd'] default: return ['-z'] } From dd553d68cee1741d7995bef18cb1788c21481d0e Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 18 Jul 2022 12:48:19 +0000 Subject: [PATCH 2/2] Fix tar test cases --- packages/cache/__tests__/tar.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cache/__tests__/tar.test.ts b/packages/cache/__tests__/tar.test.ts index 4aed759e..b05c67e1 100644 --- a/packages/cache/__tests__/tar.test.ts +++ b/packages/cache/__tests__/tar.test.ts @@ -50,7 +50,7 @@ test('zstd extract tar', async () => { `"${defaultTarPath}"`, [ '--use-compress-program', - 'zstd -d --long=30', + 'unzstd --long=30', '-xf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P', @@ -140,7 +140,7 @@ test('zstd create tar', async () => { [ '--posix', '--use-compress-program', - 'zstd -T0 --long=30', + 'zstdmt --long=30', '-cf', IS_WINDOWS ? CacheFilename.Zstd.replace(/\\/g, '/') : CacheFilename.Zstd, '--exclude', @@ -210,7 +210,7 @@ test('zstd list tar', async () => { `"${defaultTarPath}"`, [ '--use-compress-program', - 'zstd -d --long=30', + 'unzstd --long=30', '-tf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P' @@ -235,7 +235,7 @@ test('zstdWithoutLong list tar', async () => { `"${defaultTarPath}"`, [ '--use-compress-program', - 'zstd -d', + 'unzstd', '-tf', IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath, '-P'