about summary refs log tree commit diff
path: root/tvix/derivation/src/derivation.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-06T17·52+0100
committerclbot <clbot@tvl.fyi>2023-01-06T17·59+0000
commit396fdde0c054fde0a2169ba029ffb3e575627af6 (patch)
tree3ecffcc9fda932ffcef0b865647e2b5f1726a9b2 /tvix/derivation/src/derivation.rs
parent1ebda9e13e0a11d3040267134e0a23600f9faf65 (diff)
refactor(tvix/derivation): use StorePath::to_absolute_path() r/5617
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 <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/derivation/src/derivation.rs')
-rw-r--r--tvix/derivation/src/derivation.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/tvix/derivation/src/derivation.rs b/tvix/derivation/src/derivation.rs
index 550b386a7fce..04035b6b955d 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(),