From 396fdde0c054fde0a2169ba029ffb3e575627af6 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 6 Jan 2023 18:52:44 +0100 Subject: [PATCH] refactor(tvix/derivation): use StorePath::to_absolute_path() Instead of concatenating STORE_DIR manually, use StorePath::to_absolute_path() that does it for us. Change-Id: Ia288851a05b4e339679db268f3dd7924e7b65586 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7782 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/derivation/src/derivation.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tvix/derivation/src/derivation.rs b/tvix/derivation/src/derivation.rs index 550b386a7..04035b6b9 100644 --- a/tvix/derivation/src/derivation.rs +++ b/tvix/derivation/src/derivation.rs @@ -256,11 +256,8 @@ impl Derivation { let digest = hasher.finalize_reset(); - let abs_store_path = format!( - "{}/{}", - STORE_DIR, - build_store_path(false, &digest, &output_path_name)? - ); + let abs_store_path = + build_store_path(false, &digest, &output_path_name)?.to_absolute_path(); output.path = abs_store_path.clone(); self.environment @@ -295,8 +292,7 @@ impl Derivation { hasher.finalize() }; - let abs_store_path = - format!("{}/{}", STORE_DIR, build_store_path(false, &digest, name)?); + let abs_store_path = build_store_path(false, &digest, name)?.to_absolute_path(); self.outputs.insert( "out".to_string(),