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

@Cyberbeni Cyberbeni commented Jan 29, 2021

As I understant this table: https://github.com/actions/virtual-environments#available-environments
And this comment: actions/virtual-environments#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 as a code owner Jan 29, 2021
@smorimoto
Copy link
Contributor

@smorimoto smorimoto commented Jan 30, 2021

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

Loading

@Cyberbeni
Copy link
Contributor Author

@Cyberbeni 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.

Loading

@smorimoto
Copy link
Contributor

@smorimoto smorimoto commented Jan 30, 2021

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.)

Loading

Copy link
Contributor

@konradpabjan konradpabjan left a comment

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.

Loading

@Cyberbeni
Copy link
Contributor Author

@Cyberbeni Cyberbeni commented Feb 2, 2021

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)

Loading

dhadka
dhadka approved these changes Feb 2, 2021
@konradpabjan konradpabjan merged commit ccd1dd2 into actions:main Feb 2, 2021
12 checks passed
Loading
@konradpabjan
Copy link
Contributor

@konradpabjan konradpabjan commented Feb 2, 2021

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

Loading

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

Successfully merging this pull request may close these issues.

None yet

4 participants