From 26b77b2cf3138e4db236bf243b718f3de23b0529 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 26 Apr 2024 18:58:07 +0300 Subject: [PATCH] refactor(tvix/glue): move decompression into fetchers/ subdir This is specifically used for the fetcher code (only). Moving it to there for now. Change-Id: I1e1d0541b85340ef4ff3a4c6b3fa99b51853f539 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11532 Reviewed-by: edef Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/glue/src/{ => fetchers}/decompression.rs | 6 +++--- tvix/glue/src/{fetchers.rs => fetchers/mod.rs} | 5 ++++- tvix/glue/src/lib.rs | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) rename tvix/glue/src/{ => fetchers}/decompression.rs (97%) rename tvix/glue/src/{fetchers.rs => fetchers/mod.rs} (99%) diff --git a/tvix/glue/src/decompression.rs b/tvix/glue/src/fetchers/decompression.rs similarity index 97% rename from tvix/glue/src/decompression.rs rename to tvix/glue/src/fetchers/decompression.rs index 11dc9d983..f96fa60e3 100644 --- a/tvix/glue/src/decompression.rs +++ b/tvix/glue/src/fetchers/decompression.rs @@ -204,9 +204,9 @@ mod tests { } #[rstest] - #[case::gzip(include_bytes!("tests/blob.tar.gz"))] - #[case::bzip2(include_bytes!("tests/blob.tar.bz2"))] - #[case::xz(include_bytes!("tests/blob.tar.xz"))] + #[case::gzip(include_bytes!("../tests/blob.tar.gz"))] + #[case::bzip2(include_bytes!("../tests/blob.tar.bz2"))] + #[case::xz(include_bytes!("../tests/blob.tar.xz"))] #[tokio::test] async fn compressed_tar(#[case] data: &[u8]) { let reader = DecompressedReader::new(BufReader::new(data)); diff --git a/tvix/glue/src/fetchers.rs b/tvix/glue/src/fetchers/mod.rs similarity index 99% rename from tvix/glue/src/fetchers.rs rename to tvix/glue/src/fetchers/mod.rs index 7560c447d..4b53d0fda 100644 --- a/tvix/glue/src/fetchers.rs +++ b/tvix/glue/src/fetchers/mod.rs @@ -17,7 +17,10 @@ use tvix_castore::{ use tvix_store::{pathinfoservice::PathInfoService, proto::PathInfo}; use url::Url; -use crate::{builtins::FetcherError, decompression::DecompressedReader}; +use crate::builtins::FetcherError; + +mod decompression; +use decompression::DecompressedReader; /// Representing options for doing a fetch. #[derive(Clone, Eq, PartialEq)] diff --git a/tvix/glue/src/lib.rs b/tvix/glue/src/lib.rs index 8528f09e5..2e5a3be10 100644 --- a/tvix/glue/src/lib.rs +++ b/tvix/glue/src/lib.rs @@ -6,7 +6,6 @@ pub mod tvix_build; pub mod tvix_io; pub mod tvix_store_io; -mod decompression; #[cfg(test)] mod tests;