From 0db73cb2bd94ce2449571b5707de35b283da0091 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 29 Jan 2023 20:48:23 +0100 Subject: feat(tvix/store): add write_nar function 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 Tested-by: BuildkiteCI --- tvix/Cargo.nix | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'tvix/Cargo.nix') diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index 70c022ddcedd..3d16417ca89a 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -83,16 +83,6 @@ rec { # File a bug if you depend on any for non-debug work! debug = internal.debugCrate { inherit packageId; }; }; - "tvix-nar" = rec { - packageId = "tvix-nar"; - build = internal.buildRustCrateWithFeatures { - packageId = "tvix-nar"; - }; - - # Debug support which might change between releases. - # File a bug if you depend on any for non-debug work! - debug = internal.debugCrate { inherit packageId; }; - }; "tvix-serde" = rec { packageId = "tvix-serde"; build = internal.buildRustCrateWithFeatures { @@ -7971,18 +7961,6 @@ rec { } ]; - }; - "tvix-nar" = rec { - crateName = "tvix-nar"; - version = "0.0.0"; - edition = "2021"; - # We can't filter paths with references in Nix 2.4 - # See https://github.com/NixOS/nix/issues/5410 - src = - if (lib.versionOlder builtins.nixVersion "2.4pre20211007") - then lib.cleanSourceWith { filter = sourceFilter; src = ./nar; } - else ./nar; - }; "tvix-serde" = rec { crateName = "tvix-serde"; -- cgit 1.4.1