File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,21 @@ async function getTarVersion(programName: string): Promise<TarVersion> {
5353 }
5454}
5555
56+ async function pickTarCommand ( ) : Promise < TarVersion > {
57+ // bsdtar 3.5.3 on the macos-14 (arm) action runner image is prone to crash with the following
58+ // error messages when extracting zstd archives:
59+ //
60+ // tar: Child process exited with status 1
61+ // tar: Error exit delayed from previous errors.
62+ //
63+ // To avoid this problem, prefer GNU tar under the name "gtar" if it is available.
64+ try {
65+ return await getTarVersion ( "gtar" ) ;
66+ } catch {
67+ return await getTarVersion ( "tar" ) ;
68+ }
69+ }
70+
5671export interface ZstdAvailability {
5772 available : boolean ;
5873 foundZstdBinary : boolean ;
@@ -64,7 +79,7 @@ export async function isZstdAvailable(
6479) : Promise < ZstdAvailability > {
6580 const foundZstdBinary = await isBinaryAccessible ( "zstd" , logger ) ;
6681 try {
67- const tarVersion = await getTarVersion ( "tar" ) ;
82+ const tarVersion = await pickTarCommand ( ) ;
6883 const { type, version } = tarVersion ;
6984 logger . info ( `Found ${ type } tar version ${ version } .` ) ;
7085 switch ( type ) {
You can’t perform that action at this time.
0 commit comments