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

Check zstd is on the path in addition to tar version #2526

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

henrymercer
Copy link
Contributor

tar calls out to zstd to decompress a .tar.zst, so we should check the zstd binary is accessible as part of determining whether to download a .tar.zst bundle.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner October 4, 2024 18:20
src/tar.ts Outdated Show resolved Hide resolved
"Failed to determine tar version, therefore will assume zstd may not be available. " +
`The underlying error was: ${e}`,
);
return { available: false };
return { available: false, foundZstdBinary };
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the use case for knowing if zstd is available if we can't figure out what tar version is available?

Actually, I'm not sure what the use case for having foundZstdBinary as part of the interface is. Is this for telemetry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the use case for knowing if zstd is available if we can't figure out what tar version is available?

If we can't figure out what tar version is available, we want to fall back to gzip.

Actually, I'm not sure what the use case for having foundZstdBinary as part of the interface is. Is this for telemetry?

Yes, this is just to help us understand how much of the time zstd wasn't available due to the tar version and how much of the time it wasn't available due to not being able to find a zstd binary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it.

Co-authored-by: Andrew Eisenberg <[email protected]>
@henrymercer henrymercer added the Rebuild Re-transpile JS & re-generate workflows label Oct 7, 2024
@github-actions github-actions bot removed the Rebuild Re-transpile JS & re-generate workflows label Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Pushed a commit to rebuild the Action. Please mark the PR as ready for review to trigger PR checks.

@github-actions github-actions bot marked this pull request as draft October 7, 2024 09:28
@henrymercer henrymercer marked this pull request as ready for review October 7, 2024 09:28
"Failed to determine tar version, therefore will assume zstd may not be available. " +
`The underlying error was: ${e}`,
);
return { available: false };
return { available: false, foundZstdBinary };
Copy link
Contributor

Choose a reason for hiding this comment

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

Got it.

@henrymercer henrymercer merged commit c9a70ff into main Oct 7, 2024
271 checks passed
@henrymercer henrymercer deleted the henrymercer/check-zstd-on-path branch October 7, 2024 16:14
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.

2 participants