Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix issue with interactive unzip on Linux #807

Merged
merged 16 commits into from
May 21, 2021

Conversation

luketomlinson
Copy link
Contributor

@luketomlinson luketomlinson commented May 12, 2021

Resolves #456

Fixes issue where unzip would freeze when asking for interactive input.

This unifies the behavior across platforms to overwrite files instead of failing (windows, previously) or asking for user input (macOS and linux previously).

@luketomlinson luketomlinson changed the title Change unzip overwrite Bugfix: Fix issue with interactive unzip on Linux May 14, 2021
@luketomlinson luketomlinson force-pushed the bugfix/interactive-unzip branch from 70491f6 to b31bbe5 Compare May 14, 2021 18:17
@luketomlinson luketomlinson marked this pull request as ready for review May 18, 2021 13:35
@luketomlinson luketomlinson requested a review from a team as a code owner May 18, 2021 13:35
@luketomlinson luketomlinson merged commit a1b068e into main May 21, 2021
@luketomlinson luketomlinson deleted the bugfix/interactive-unzip branch May 21, 2021 21:01
@StevenACoffman
Copy link

StevenACoffman commented Feb 27, 2022

Hi. This doesn't appear to be fully resolved.

As I can see the extractTar function is imported from internal package: https://github.com/actions/toolkit/blob/main/packages/cache/src/cache.ts#L5 and the internal implementation does not contain --overwrite flag:

export async function extractTar(
archivePath: string,
compressionMethod: CompressionMethod
): Promise<void> {
// Create directory to extract tar into
const workingDirectory = getWorkingDirectory()
await io.mkdirP(workingDirectory)
// --d: Decompress.
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
// Using 30 here because we also support 32-bit self-hosted runners.
function getCompressionProgram(): string[] {
switch (compressionMethod) {
case CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -d --long=30']
case CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -d']
default:
return ['-z']
}
}
const args = [
...getCompressionProgram(),
'-xf',
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
'-P',
'-C',
workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
]
await execTar(args, compressionMethod)
}

so there is no way to fix the issue within this action, while GitHub Action uses tar without --overwrite flag.

Copy link

@lawyoum lawyoum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unziping tools from cache on linux freezes the entire workflow in interactive mode waiting for user input
4 participants