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-06T15·27+0100
committerflokli <flokli@flokli.de>2023-01-06T15·39+0000
commitc89af03a030b8447954d17972ce6f64fb6d42f57 (patch)
tree252edef441896ec9ce3111c663d5d576e76e3379 /tvix/derivation/src/derivation.rs
parent999afd4be27619657a10d3031f289f627bb029b1 (diff)
refactor(tvix/store): rename NixPath to StorePath r/5613
As discussed in #tvl, this is a more common term for it.

Change-Id: I9b904222b8c076f82192c9b7f0b42be171614ab7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7776
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/derivation/src/derivation.rs')
-rw-r--r--tvix/derivation/src/derivation.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tvix/derivation/src/derivation.rs b/tvix/derivation/src/derivation.rs
index 2afe672e2e9b..bf26e1baac69 100644
--- a/tvix/derivation/src/derivation.rs
+++ b/tvix/derivation/src/derivation.rs
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
 use sha2::{Digest, Sha256};
 use std::{collections::BTreeMap, fmt, fmt::Write};
 use tvix_store::nixbase32::NIXBASE32;
-use tvix_store::nixpath::{NixPath, ParseNixPathError, STORE_DIR};
+use tvix_store::nixpath::{ParseStorePathError, StorePath, STORE_DIR};
 
 #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
 pub struct Derivation {
@@ -34,10 +34,10 @@ fn build_store_path(
     is_derivation: bool,
     path_hash: &[u8],
     name: &str,
-) -> Result<NixPath, ParseNixPathError> {
+) -> Result<StorePath, ParseStorePathError> {
     let compressed = nix_hash::compress_hash(path_hash, 20);
     if is_derivation {
-        NixPath::from_string(
+        StorePath::from_string(
             format!(
                 "{}-{}{}",
                 NIXBASE32.encode(&compressed),
@@ -47,7 +47,7 @@ fn build_store_path(
             .as_str(),
         )
     } else {
-        NixPath::from_string(format!("{}-{}", NIXBASE32.encode(&compressed), name,).as_str())
+        StorePath::from_string(format!("{}-{}", NIXBASE32.encode(&compressed), name,).as_str())
     }
 }
 
@@ -105,8 +105,8 @@ impl Derivation {
     ///   - Write the .drv A-Term contents to a hash function
     ///   - Take the digest, run hash.CompressHash(digest, 20) on it.
     ///   - Encode it with nixbase32
-    ///   - Use it (and the name) to construct a NixPath.
-    pub fn calculate_derivation_path(&self, name: &str) -> Result<NixPath, ParseNixPathError> {
+    ///   - Use it (and the name) to construct a [StorePath].
+    pub fn calculate_derivation_path(&self, name: &str) -> Result<StorePath, ParseStorePathError> {
         let mut hasher = Sha256::new();
 
         // collect the list of paths from input_sources and input_derivations
@@ -223,7 +223,7 @@ impl Derivation {
         &mut self,
         name: &str,
         drv_replacement_str: &str,
-    ) -> Result<(), ParseNixPathError> {
+    ) -> Result<(), ParseStorePathError> {
         let mut hasher = Sha256::new();
 
         // Check if the Derivation is fixed output, because they cause