From 45cf7ae657086993cedaa7c72b813e319e805484 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 10 Apr 2024 16:33:02 +0300 Subject: refactor(tvix/nix-compat): move nar writer to tokio 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 Reviewed-by: Brian Olsen --- tvix/store/src/nar/renderer.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tvix/store') 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: 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)?; -- cgit 1.4.1