toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

actions/cache assumes zstdmt to be installed

Open andymcblane opened this issue 10 months ago • 1 comments

Describe the bug actions/cache assumes zstdmt is installed without checking.

https://github.com/actions/toolkit/blob/81a73aba8bedd532f6eddcc41ed3a0fad8b1cfeb/packages/cache/src/internal/tar.ts#L241

I'm using actions/cache@v4 on Ubuntu 20.04 as a self-managed runner.

zstd --version -> *** zstd command line interface 64-bits v1.5.0, by Yann Collet ***

zstd --long -> (�/�$

/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner8/runner/_work/ourrepo/ourrepo --files-from manifest.txt --use-compress-program zstdmt
/bin/sh: 1: zstdmt: not found
/usr/bin/tar: cache.tzst: Wrote only 4096 of 10240 bytes
/usr/bin/tar: Child returned status 127
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Failed to save: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2

andymcblane avatar Apr 26 '24 02:04 andymcblane

~This occurs as getCompressionMethod() only returns CompressionMethod.Gzip or CompressionMethod.ZstdWithoutLong If it was to return CompressionMethod.Zstd then it will run zstdmt --long=30 compared to zstdmt~

~Suggestion is to re-work getCompressionMethod() to be aware if zstdmt is installed or not.~

These above assumptions were incorrect.

andymcblane avatar Apr 26 '24 02:04 andymcblane