Skip to content

tar: add explicit zstd compression support#154

Merged
kaladron merged 2 commits into
uutils:mainfrom
kevinburke:zstd-support
Jun 15, 2026
Merged

tar: add explicit zstd compression support#154
kaladron merged 2 commits into
uutils:mainfrom
kevinburke:zstd-support

Conversation

@kevinburke

Copy link
Copy Markdown
Contributor

Add an explicit --zstd flag for create, list, and extract so .tar.zst archives work end to end.

Keep the scope narrow by requiring the flag instead of trying to autodetect compression. Add CLI coverage and end-to-end tests for creating, listing, and extracting zstd-compressed archives.

@codecov

codecov Bot commented Apr 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.28997% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.89%. Comparing base (cef2373) to head (3031184).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/tar/src/operations/compression.rs 87.34% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   96.78%   96.89%   +0.10%     
==========================================
  Files           9       11       +2     
  Lines        1121     1481     +360     
  Branches       28       29       +1     
==========================================
+ Hits         1085     1435     +350     
- Misses         35       45      +10     
  Partials        1        1              
Flag Coverage Δ
macos_latest 96.89% <97.28%> (+0.10%) ⬆️
ubuntu_latest 96.89% <97.28%> (+0.10%) ⬆️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kaladron kaladron self-requested a review April 4, 2026 18:01
@kaladron

kaladron commented Apr 4, 2026

Copy link
Copy Markdown
Collaborator

Hi! I'm in the middle of implementing "-f -", and this patch as it's structured will make that work difficult. If you don't mind, I'd like to hold this patch until that lands and I'll rework it. (I also have #149 that centralises the error handling)

@kaladron kaladron self-assigned this Apr 4, 2026
@kevinburke

Copy link
Copy Markdown
Contributor Author

no problem - can you ping me when that's complete?

@kaladron

kaladron commented Apr 4, 2026

Copy link
Copy Markdown
Collaborator

Will do! I'm blocked on review of mine, and then I can review yours =)

@kevinburke kevinburke force-pushed the zstd-support branch 2 times, most recently from 13bbb47 to 2b4877b Compare April 4, 2026 19:28
@kevinburke

Copy link
Copy Markdown
Contributor Author

Hello! I think this is ready for another look

@kaladron

kaladron commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for updating . the commit I wanted to get in is now in, I'm planning to review your two compression PRs in the next few days.

@kaladron kaladron closed this Jun 8, 2026
@kaladron kaladron reopened this Jun 8, 2026
@kaladron

kaladron commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

(wrong button, sorry!)

@kaladron kaladron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm sorry about the delay in doing this review!

Can you please make sure that the benchmark code in benches/bench_tar.rs is updated for the changed signatures?

Otherwise this looks good to me.

Comment thread src/uu/tar/src/operations/create.rs Outdated
/// - Any input file cannot be read
/// - Files cannot be added due to I/O or permission errors
pub fn create_archive(
pub(crate) fn create_archive(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are you changing the visibility? This would break the benchmark stuff that imports this for testing.

Add an explicit --zstd flag for create, list, and extract so
.tar.zst archives work end to end.

Keep the scope narrow by requiring the flag instead of trying to
autodetect compression. Add CLI coverage and end-to-end tests for
creating, listing, and extracting zstd-compressed archives.
Pass CompressionMode::None from the existing tar benchmarks after the archive operation helpers gained explicit compression arguments.

Keep the operation helpers and CompressionMode public so the external benchmark target can continue importing them through the uu_tar library.
@codspeed-hq

codspeed-hq Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing kevinburke:zstd-support (3031184) with main (815a1b3)

Open in CodSpeed

@kaladron kaladron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fixes!

@kaladron kaladron merged commit a997eda into uutils:main Jun 15, 2026
19 checks passed
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