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

Use GNU tar on macOS if available #701

Merged
merged 7 commits into from Feb 2, 2021
Merged

Use GNU tar on macOS if available #701

merged 7 commits into from Feb 2, 2021

Conversation

Cyberbeni
Copy link
Contributor

As I understant this table: https://github.com/actions/virtual-environments#available-environments
And this comment: actions/runner-images#1534 (comment)
The 20210123 images are the first ones to contain GNU tar and they are at 90%+ rollout progress.

This aims to fix multiple people's issues with caching inside macOS actions:
actions/cache#403
https://github.community/t/bizarre-issue-with-tar-archive-for-macos-build/145377
Cyberbeni/install-swift-tool#69

@Cyberbeni Cyberbeni requested a review from a team January 29, 2021 22:07
@smorimoto
Copy link
Contributor

PRs for this is already open and it's focused on support more platforms.

@Cyberbeni
Copy link
Contributor Author

Cyberbeni commented Jan 30, 2021

PRs for this is already open and it's focused on support more platforms.

Yeah, that PR looks pretty messy and incorrect and abandoned.

You neglected the fact that gnu-tar was not even installed on macOS runners at that time (but thankfully that request went through pretty smoothly), it is also included in the path as gtar by default (so checking the version of all tars in the path won't work) and checking for the output of version makes it way harder to intentionally override in case you have a problem with GNU tar and want to actually keep using BSD tar for caching for some reason and don't want to fork everything that uses caching in your workflow just to do that.

This pull request aims to fix exactly 1 problem (tar often resulting in malformed output on macOS) without making possibly breaking changes in other platforms/cases. I would prefer you not break caching on macOS when you only have a different problem with caching on Windows.

@smorimoto
Copy link
Contributor

You should know that not only Windows, but also all platforms are having problems.
I agree with the delay in the review process, but it doesn't make the review process faster just because the scope of the effect is small. (The Actions team's review process is basically slow.)

Copy link
Contributor

@konradpabjan konradpabjan left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for putting out this PR.

I'm going to do a little bit more testing before merging this in and then I'll publish a new version of @actions/cache that can then be used in the our first party action.

@Cyberbeni
Copy link
Contributor Author

I've tested the most obvious edge case a while ago (restore cache saved with bsd tar) and it worked fine: https://github.com/Cyberbeni/install-swift-tool/runs/1456400103#step:4:30

(The workflow later runs the restored binary)

@konradpabjan konradpabjan merged commit ccd1dd2 into actions:main Feb 2, 2021
@konradpabjan
Copy link
Contributor

Published a new release with the changes: https://www.npmjs.com/package/@actions/cache/v/1.0.6

This was referenced Mar 17, 2021
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.

None yet

4 participants