From 8d05c0ceaa9bddb7fdaab436730f093eb16374a2 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 8 Jun 2023 23:00:37 +0300 Subject: refactor(tvix/src/nar): drop NARCalculationService There's only one way to calculate NAR files, by walking through them. Things like caching such replies should be done closer to where we use these, composing NARCalculationService doesn't actually give us much. Instead, expose two functions, `nar::calculate_size_and_sha256` and `nar::writer_nar`, the latter writing NAR to a writer, the former using write_nar to only keeping the NAR size and digest. Change-Id: Ie5d2cfea35470fdbb5cbf9da1136b0cdf0250266 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8723 Reviewed-by: tazjin Tested-by: BuildkiteCI Autosubmit: flokli --- tvix/cli/src/main.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'tvix/cli/src/main.rs') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 459177717c..0a1794006d 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -73,20 +73,11 @@ fn interpret(code: &str, path: Option, args: &Args, explain: bool) -> b let blob_service = MemoryBlobService::default(); let directory_service = MemoryDirectoryService::default(); - let path_info_service = MemoryPathInfoService::default(); - let nar_calculation_service = tvix_store::nar::NonCachingNARCalculationService::new( - Box::new(blob_service.clone()), - directory_service.clone(), - ); + let path_info_service = MemoryPathInfoService::default(); // TODO: update to pass in blob and directory svc eval.io_handle = Box::new(tvix_io::TvixIO::new( known_paths.clone(), - tvix_store::TvixStoreIO::new( - Box::new(blob_service), - directory_service, - path_info_service, - nar_calculation_service, - ), + tvix_store::TvixStoreIO::new(Box::new(blob_service), directory_service, path_info_service), )); // bundle fetchurl.nix (used in nixpkgs) by resolving to -- cgit 1.4.1