about summary refs log tree commit diff
path: root/tvix/store/src/tests/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-29T19·48+0100
committerflokli <flokli@flokli.de>2023-01-31T15·28+0000
commit0db73cb2bd94ce2449571b5707de35b283da0091 (patch)
tree01403c551647dc6567edf0085fa3128092a9e075 /tvix/store/src/tests/mod.rs
parenta23b7e17c04453a4d5ea2d47a88c6c6874471c08 (diff)
feat(tvix/store): add write_nar function r/5794
This adds a function that consumes a [proto::node::Node] pointing to the
root of a (store) path, and writes the contents in NAR serialization to
the passed [std::io::Write].

We need this in various places:

 - tvix-store's calculate_nar() RPC method needs to render a NAR stream
   to get the nar hash, which is necessary to give things imported in
   the store a "NAR-based" store path.

 - communication with (remote) Nix (via daemon protocol) needs a NAR
   representation.

 - Things like nar-bridge, exposing a NAR/NARInfo HTTP interface need a
   NAR representation.

Change-Id: I7fb2e0bf01814a1c09094c0e35394d9d6b3e43b6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7956
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/tests/mod.rs')
-rw-r--r--tvix/store/src/tests/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/store/src/tests/mod.rs b/tvix/store/src/tests/mod.rs
index 4022c32979..57ae1df9f6 100644
--- a/tvix/store/src/tests/mod.rs
+++ b/tvix/store/src/tests/mod.rs
@@ -1,5 +1,6 @@
 mod directory;
 mod directory_nodes_iterator;
 mod directory_service;
+mod nar;
 mod path_info_service;
 mod pathinfo;