feat(tvix/glue): Add AsyncRead wrapper to decompress streams

Add a new AsyncRead wrapper, DecompressedReader, that wraps an
underlying AsyncRead, but sniffs the magic bytes at the start of the
stream to determine which compression format is being used out of the
three that are supported by builtins.fetchTarball, and switches to the
correct decompression algorithm adapter dynamically.

This will be used in the implementation of builtins.fetchTarball

Change-Id: I892a4683d5c93e67d4c173f3d21199bdc6605922
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11019
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Aspen Smith 2024-02-23 14:42:52 -05:00 committed by aspen
parent de727bccf9
commit 54609e8c17
8 changed files with 777 additions and 1 deletions

View file

@ -5,6 +5,7 @@ pub mod tvix_build;
pub mod tvix_io;
pub mod tvix_store_io;
mod decompression;
#[cfg(test)]
mod tests;