diff options
author | Florian Klink <flokli@flokli.de> | 2024-04-10T13·33+0300 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-04-13T10·09+0000 |
commit | 45cf7ae657086993cedaa7c72b813e319e805484 (patch) | |
tree | c4013d2072f37df7563a6dc3b3f4e4c1631cff21 /tvix/store/src/nar | |
parent | 742937d55c1e156933b463312b77ca07ebd1d063 (diff) |
refactor(tvix/nix-compat): move nar writer to tokio r/7898
There's little reason to keep the nar writer using Async{Read,Write} traits from futures, while everything else async in tvix (and nix-compat) uses tokio. Change-Id: I8cd1efcd0dd5bb76471de997603c7b701a5095de Reviewed-on: https://cl.tvl.fyi/c/depot/+/11391 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Reviewed-by: Brian Olsen <me@griff.name>
Diffstat (limited to 'tvix/store/src/nar')
-rw-r--r-- | tvix/store/src/nar/renderer.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tvix/store/src/nar/renderer.rs b/tvix/store/src/nar/renderer.rs index 36d184f3b6c5..0816b8e973c7 100644 --- a/tvix/store/src/nar/renderer.rs +++ b/tvix/store/src/nar/renderer.rs @@ -6,7 +6,6 @@ use count_write::CountWrite; use nix_compat::nar::writer::r#async as nar_writer; use sha2::{Digest, Sha256}; use tokio::io::{self, AsyncWrite, BufReader}; -use tokio_util::compat::{TokioAsyncReadCompatExt, TokioAsyncWriteCompatExt}; use tvix_castore::{ blobservice::BlobService, directoryservice::DirectoryService, @@ -45,7 +44,7 @@ where /// necessary lookups as it traverses the structure. /// The contents in NAR serialization are writen to the passed [AsyncWrite]. pub async fn write_nar<W, BS, DS>( - w: W, + mut w: W, proto_root_node: &castorepb::node::Node, blob_service: BS, directory_service: DS, @@ -56,7 +55,6 @@ where DS: DirectoryService + Send, { // Initialize NAR writer - let mut w = w.compat_write(); let nar_root_node = nar_writer::open(&mut w) .await .map_err(RenderError::NARWriterError)?; @@ -101,7 +99,7 @@ where )) })?; - let blob_reader = match blob_service + let mut blob_reader = match blob_service .open_read(&digest) .await .map_err(RenderError::StoreError)? @@ -117,7 +115,7 @@ where .file( proto_file_node.executable, proto_file_node.size, - &mut blob_reader.compat(), + &mut blob_reader, ) .await .map_err(RenderError::NARWriterError)?; |