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> {
53
53
}
54
54
}
55
55
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
+
56
71
export interface ZstdAvailability {
57
72
available : boolean ;
58
73
foundZstdBinary : boolean ;
@@ -64,7 +79,7 @@ export async function isZstdAvailable(
64
79
) : Promise < ZstdAvailability > {
65
80
const foundZstdBinary = await isBinaryAccessible ( "zstd" , logger ) ;
66
81
try {
67
- const tarVersion = await getTarVersion ( "tar" ) ;
82
+ const tarVersion = await pickTarCommand ( ) ;
68
83
const { type, version } = tarVersion ;
69
84
logger . info ( `Found ${ type } tar version ${ version } .` ) ;
70
85
switch ( type ) {
You can’t perform that action at this time.
0 commit comments