diff options
Diffstat (limited to 'tvix/store')
-rw-r--r-- | tvix/store/Cargo.toml | 1 | ||||
-rw-r--r-- | tvix/store/src/nar/import.rs | 15 | ||||
-rw-r--r-- | tvix/store/src/nar/renderer.rs | 14 |
3 files changed, 17 insertions, 13 deletions
diff --git a/tvix/store/Cargo.toml b/tvix/store/Cargo.toml index 7034a95f3808..f82cdef30077 100644 --- a/tvix/store/Cargo.toml +++ b/tvix/store/Cargo.toml @@ -40,7 +40,6 @@ tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] } tvix-castore = { path = "../castore" } url = "2.4.0" walkdir = "2.4.0" -async-recursion = "1.0.5" reqwest = { version = "0.11.22", features = ["rustls-tls-native-roots", "stream"], default-features = false } [dependencies.tonic-reflection] diff --git a/tvix/store/src/nar/import.rs b/tvix/store/src/nar/import.rs index bfb65629e6b6..cc62c1a4e902 100644 --- a/tvix/store/src/nar/import.rs +++ b/tvix/store/src/nar/import.rs @@ -1,4 +1,3 @@ -use async_recursion::async_recursion; use nix_compat::nar::reader::r#async as nar_reader; use tokio::{io::AsyncBufRead, sync::mpsc, try_join}; use tvix_castore::{ @@ -54,10 +53,9 @@ where Ok(node.rename("".into())) } -#[async_recursion] -async fn produce_nar_inner<'a: 'async_recursion, 'r: 'async_recursion, BS>( +async fn produce_nar_inner<BS>( blob_service: BS, - node: nar_reader::Node<'a, 'r>, + node: nar_reader::Node<'_, '_>, path: PathBuf, tx: mpsc::Sender<Result<IngestionEntry, Error>>, ) -> Result<IngestionEntry, Error> @@ -93,8 +91,13 @@ where path.try_push(&entry.name) .expect("Tvix bug: failed to join name"); - let entry = - produce_nar_inner(blob_service.clone(), entry.node, path, tx.clone()).await?; + let entry = Box::pin(produce_nar_inner( + blob_service.clone(), + entry.node, + path, + tx.clone(), + )) + .await?; tx.send(Ok(entry)).await.map_err(|e| { Error::IO(std::io::Error::new(std::io::ErrorKind::BrokenPipe, e)) diff --git a/tvix/store/src/nar/renderer.rs b/tvix/store/src/nar/renderer.rs index 0816b8e973c7..3b39f700bd38 100644 --- a/tvix/store/src/nar/renderer.rs +++ b/tvix/store/src/nar/renderer.rs @@ -1,7 +1,6 @@ use crate::utils::AsyncIoBridge; use super::RenderError; -use async_recursion::async_recursion; use count_write::CountWrite; use nix_compat::nar::writer::r#async as nar_writer; use sha2::{Digest, Sha256}; @@ -72,9 +71,8 @@ where /// Process an intermediate node in the structure. /// This consumes the node. -#[async_recursion] async fn walk_node<BS, DS>( - nar_node: nar_writer::Node<'async_recursion, '_>, + nar_node: nar_writer::Node<'_, '_>, proto_node: &castorepb::node::Node, blob_service: BS, directory_service: DS, @@ -164,9 +162,13 @@ where .await .map_err(RenderError::NARWriterError)?; - (blob_service, directory_service) = - walk_node(child_node, &proto_node, blob_service, directory_service) - .await?; + (blob_service, directory_service) = Box::pin(walk_node( + child_node, + &proto_node, + blob_service, + directory_service, + )) + .await?; } // close the directory |