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

Add Zstandard support in avocado.utils.archive #5609

Closed
philmd opened this issue Feb 13, 2023 · 1 comment · Fixed by #5612
Closed

Add Zstandard support in avocado.utils.archive #5609

philmd opened this issue Feb 13, 2023 · 1 comment · Fixed by #5612

Comments

@philmd
Copy link

philmd commented Feb 13, 2023

Is your feature request related to a problem? Please describe.
The QEMU project uses the Avocado framework, in particular the avocado.utils.archive class.
This class support various compression format, but not the Zstandard one.

Describe the solution you'd like
Native support of Zstandard in avocado.utils.archive.

Describe alternatives you've considered
We call zstd directly:
https://lore.kernel.org/qemu-devel/20230207204433.752020-1-alex.bennee@linaro.org/

clebergnu added a commit to clebergnu/avocado that referenced this issue Feb 14, 2023
This is preliminary work in order to allow for zstd archives to be
compressed and uncompressed by the common API available in
avocado.utils.archive.

It simply adds the ability to check if files seem to be zstd, and adds
that check to the "is_archive" condition.

Another reason for this trivial preliminary work is that it doesn't
seem like even the most basic support for uncompressing zstd archives
will be possible without the use of the zstd tool itself.  This brings
a novelty to this module implementation, in which some level of
graceful degradation or capabilities pattern will be needed.  There is
some prior art on "avocado.utils.iso9660" that can be used on the
complete uncompress/compress implementation.

Reference: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
@clebergnu
Copy link
Contributor

Hi @philmd,

Thanks for creating this issue about this QEMU requirement... real world use cases are my personal favorite kind of issues.

This shouldn't be hard (as long as we don't want to re-implement the standard within Avocado in pure Python), but it will require a bit of refactor in the avocado.utils.archive module to deal with the possibly missing tools doing the actual hard work.

Just to get things going, I've sent #5611, and I'll follow up soon with the next steps.

clebergnu added a commit to clebergnu/avocado that referenced this issue Feb 14, 2023
This adds support for extracting zstd archives using the
avocado.utils.archive.uncompress API, and is similar to the feature
level introduced earlier for lzma archives.

In the future it should be possible to expand this with:

* support for compression
* support for more backends (such as python-zstd or python-zstandard)

All in all, this should be enough to fulfill the use case described
in the matching issue.

Fixes: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
clebergnu added a commit to clebergnu/avocado that referenced this issue Feb 14, 2023
This adds support for extracting zstd archives using the
avocado.utils.archive.uncompress API, and is similar to the feature
level introduced earlier for lzma archives.

In the future it should be possible to expand this with:

* support for compression
* support for more backends (such as python-zstd or python-zstandard)

All in all, this should be enough to fulfill the use case described
in the matching issue.

Fixes: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
clebergnu added a commit to clebergnu/avocado that referenced this issue Feb 15, 2023
This adds support for extracting zstd archives using the
avocado.utils.archive.uncompress API, and is similar to the feature
level introduced earlier for lzma archives.

In the future it should be possible to expand this with:

* support for compression
* support for more backends (such as python-zstd or python-zstandard)

All in all, this should be enough to fulfill the use case described
in the matching issue.

Fixes: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
maramsmurthy pushed a commit to maramsmurthy/avocado that referenced this issue Sep 6, 2023
This is preliminary work in order to allow for zstd archives to be
compressed and uncompressed by the common API available in
avocado.utils.archive.

It simply adds the ability to check if files seem to be zstd, and adds
that check to the "is_archive" condition.

Another reason for this trivial preliminary work is that it doesn't
seem like even the most basic support for uncompressing zstd archives
will be possible without the use of the zstd tool itself.  This brings
a novelty to this module implementation, in which some level of
graceful degradation or capabilities pattern will be needed.  There is
some prior art on "avocado.utils.iso9660" that can be used on the
complete uncompress/compress implementation.

Reference: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
maramsmurthy pushed a commit to maramsmurthy/avocado that referenced this issue Sep 6, 2023
This adds support for extracting zstd archives using the
avocado.utils.archive.uncompress API, and is similar to the feature
level introduced earlier for lzma archives.

In the future it should be possible to expand this with:

* support for compression
* support for more backends (such as python-zstd or python-zstandard)

All in all, this should be enough to fulfill the use case described
in the matching issue.

Fixes: avocado-framework#5609
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants