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 <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
parent
27ff98000b
commit
8d05c0ceaa
11 changed files with 258 additions and 346 deletions
|
@ -73,20 +73,11 @@ fn interpret(code: &str, path: Option<PathBuf>, 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 <nix> to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue