Skip to content

Use libarchive for all decompression (except brotli) - #3333

Merged
edolstra merged 3 commits into
NixOS:masterfrom
serokell:libarchive-decompress
Apr 15, 2021
Merged

edolstra merged 3 commits into
NixOS:masterfrom
serokell:libarchive-decompress

Conversation

@yorickvP

@yorickvP yorickvP commented Jan 27, 2020 •

Copy link
Copy Markdown
Contributor

Libarchive, introduced in an earlier PR, can be used for arbitrary compression and decompression, as well as tar files. This handles support for (de)compression with gzip, bzip2, lzip, xz, lzma, zstd or compress. The main new feature here is zstd support.

The thing conspicuously missing here is brotli. This is because brotli does not have a magic header, so it cannot be automatically detected. We will still have to work around this, all other tests pass.

Fixes #2255.

Todo
cc:

@tomberek @puckipedia

@tomberek

Copy link
Copy Markdown
Contributor

Exciting change. How are you building and testing zstd? I presume this will come with some release-common.nix and configure.ac changes.

@yorickvP

Copy link
Copy Markdown
Contributor Author

libarchive already links statically with zstd (and falls back to zstd command line binary when it's not). No further changes are required. It might be good to test zstd specifically, if we plan on using it in global binary caches.

@tomberek

Copy link
Copy Markdown
Contributor

Yes, while testing zstd it seems to fallback and then not find the command line binary (I specifically uninstalled it to check this).

@domenkozar

Copy link
Copy Markdown
Member

@domenkozar

Copy link
Copy Markdown
Member

@yorickvP what's missing here?

@domenkozar

Copy link
Copy Markdown
Member

Talking to @yorickvP this needs brolti fallback to the old behavior since there's no magic byte header.

@yorickvP
yorickvP force-pushed the libarchive-decompress branch from c527f7a to 8a0c00b Compare March 10, 2021 21:42
@yorickvP
yorickvP marked this pull request as ready for review March 10, 2021 21:47
@yorickvP

Copy link
Copy Markdown
Contributor Author

Okay, this code now passes all tests.

@domenkozar
domenkozar requested a review from edolstra March 18, 2021 17:57
@domenkozar

Copy link
Copy Markdown
Member

Once serokell#4 is merged, this PR will have tests and can be reviewed.

@domenkozar

domenkozar commented Apr 13, 2021 •

Copy link
Copy Markdown
Member

@edolstra I'd really like this merged, could you review this PR?

@edolstra
edolstra merged commit 6fb7582 into NixOS:master Apr 15, 2021
@edolstra

Copy link
Copy Markdown
Member

Thanks, merged!

@domenkozar

Copy link
Copy Markdown
Member

Wohooo 🥳

@dtzWill

dtzWill commented Sep 1, 2021

Copy link
Copy Markdown
Member

I'm looking at my PR for adding compression level option-- which is mentioned as possibly on the TODO, thank you -- and was wondering if you happen to have looked into that at all? I've yet to read through these changes or look into how libarchive works yet so not sure if there were issues there or just wasn't a priority / mess plumbing things or whatever :).

Thanks regardless, have a good one!

@nixos-discourse

Copy link
Copy Markdown

@nixos-discourse

Copy link
Copy Markdown

@nixos-discourse

Copy link
Copy Markdown

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.

Support zstd compression for binary caches

6 participants