From cbd72b56b24b9525e5a5fb59429eb01cfec39920 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 4 Nov 2023 13:33:31 +0200 Subject: feat(tvix/store/nar): add read_nar method This adds a function that can ingest a NAR file into a given blob_service and directory_service, returning the root node. Passing around the directory_putter is a bit annoying, but at least for this linear "reading through a NAR" case, we don't need it to be clone or sync. Change-Id: Ia26d596f5dffc6dbd69aa39a82b59bba41685a9c Reviewed-on: https://cl.tvl.fyi/c/depot/+/9915 Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/store/src/nar/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tvix/store/src/nar/mod.rs') diff --git a/tvix/store/src/nar/mod.rs b/tvix/store/src/nar/mod.rs index fc6805e9e758..25a9e18826c8 100644 --- a/tvix/store/src/nar/mod.rs +++ b/tvix/store/src/nar/mod.rs @@ -1,7 +1,9 @@ use data_encoding::BASE64; use tvix_castore::{B3Digest, Error}; +mod import; mod renderer; +pub use import::read_nar; pub use renderer::calculate_size_and_sha256; pub use renderer::write_nar; -- cgit 1.4.1