about summary refs log tree commit diff
path: root/tvix/store/src/nar/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-11-04T11·33+0200
committerflokli <flokli@flokli.de>2023-11-05T12·23+0000
commitcbd72b56b24b9525e5a5fb59429eb01cfec39920 (patch)
treeb1541cf78533a9c7f02acd3769fd8c9849034e4a /tvix/store/src/nar/mod.rs
parent6d7e619b8fa7090b2e3dfced5e5f094980ea2c0a (diff)
feat(tvix/store/nar): add read_nar method r/6951
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 <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/store/src/nar/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tvix/store/src/nar/mod.rs b/tvix/store/src/nar/mod.rs
index fc6805e9e7..25a9e18826 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;