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

Prefer using GNU tar #553

Closed
wants to merge 1 commit into from
Closed

Prefer using GNU tar #553

wants to merge 1 commit into from

Conversation

dhadka
Copy link
Member

@dhadka dhadka commented Aug 10, 2020

Fixes a variety of actions/cache issues related to differences between BSD and GNU tar.

The old which function already scanned the system path for the executable, but would return the first hit. This change moves most of this functionality into a new method, findInPath, which will return a list of all matches on the system path. This allows the cache module to scan all available tar implementations to find GNU tar.

Fixes #552
Fixes actions/cache#362 - OS-agnostic caches miss on Windows due to different compression (caused by zstd issue)
Fixes actions/cache#315 - infinite recursion in bsdtar caused by junction points on windows
Fixes actions/cache#301 - zstd hangs when used with bsdtar

@dhadka dhadka force-pushed the dhadka/gnutar branch 4 times, most recently from 0aeda7f to 17eb221 Compare August 11, 2020 03:19
if (filePath) {
return filePath
}
/**
Copy link
Member Author

Choose a reason for hiding this comment

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

Most of the which method is now in findInPath. Most of the changes are just indentation...use the "hide whitespace changes" option for easier viewing.

@@ -64,7 +64,7 @@ async function getVersion(app: string): Promise<string> {
core.debug(`Checking ${app} --version`)
let versionOutput = ''
try {
await exec.exec(`${app} --version`, [], {
await exec.exec(`"${app}" --version`, [], {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
await exec.exec(`"${app}" --version`, [], {
await exec.exec(app, ['--version'], {

@smorimoto
Copy link
Contributor

@dhadka Is there any progress on this? If you are busy, I can take over this.

casey added a commit to casey/bendy that referenced this pull request Nov 19, 2020
The BSD Tar that ships with macOS has a bug that can cause it to create
empty tar files, which can cause bad caches to be created on GitHub
Actions.

An example of this error is here:

    https://github.com/P3KI/bendy/pull/48/checks?check_run_id=1421741031#step:9:39

And here are a couple discussions:

    actions/cache#403
    actions/toolkit#553

As a workaround, this patch installs GNU Tar on macos in all jobs that
use the cache. It also adds `0-` to all cache keys to make sure that
future CI builds don't hit the old, corrupted cache. This can be removed
once `Cargo.lock` changes.
@dhadka
Copy link
Member Author

dhadka commented May 3, 2021

Closing for #610

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