From ff40332864b6b19f8d9a2f587dbcf7e05e3d16f8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 11 Jun 2024 15:46:52 +0300 Subject: refactor(tvix/store/nar/import): add ingest_nar_and_hash This wraps ingest_nar, but also keeps track of the number of bytes read, and calculates the sha256 digest of it. Make use of it in the NixHTTPPathInfoService, where this code is coming from. Change-Id: I9c54e93d3ec8ed9ede87aed43e04d114fb06897b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11787 Reviewed-by: Connor Brewster Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/store/src/nar/mod.rs | 1 + 1 file changed, 1 insertion(+) (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 164748a655e8..8cbb091f1aab 100644 --- a/tvix/store/src/nar/mod.rs +++ b/tvix/store/src/nar/mod.rs @@ -4,6 +4,7 @@ use tvix_castore::B3Digest; mod import; mod renderer; pub use import::ingest_nar; +pub use import::ingest_nar_and_hash; pub use renderer::calculate_size_and_sha256; pub use renderer::write_nar; pub use renderer::SimpleRenderer; -- cgit 1.4.1