about summary refs log tree commit diff
path: root/tvix/store
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-31T14·20-0400
committerJohn Ericson <git@johnericson.me>2023-04-09T15·12+0000
commit26c68f8e892633bde4aeebbfc0e4ae7ee571687d (patch)
treee6ee1bcf805ceb83b974f6d1c6a8e7d0b30a9b1f /tvix/store
parentb4670bfbd16dd80fb52e61e79b4aa6e1d0453570 (diff)
refactor(nix-compat): Properly encapsulate store path construction r/6088
Before there was code scattered about (e.g. text hashing module and
derivation output computation) constructing store paths from low level
building blocks --- there was some duplication and it was easy to make
nonsense store paths.

Now, we have roughly the same "safe-ish" ways of constructing them as
C++ Nix, and only those are exposed:

- Make text hashed content-addressed store paths

- Make other content-addressed store paths

- Make input-addressed fixed output hashes

Change-Id: I122a3ee0802b4f45ae386306b95b698991be89c8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8411
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store')
-rw-r--r--tvix/store/src/proto/tests/pathinfo.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/store/src/proto/tests/pathinfo.rs b/tvix/store/src/proto/tests/pathinfo.rs
index 0cc8f87587f1..54a76fc6c554 100644
--- a/tvix/store/src/proto/tests/pathinfo.rs
+++ b/tvix/store/src/proto/tests/pathinfo.rs
@@ -66,7 +66,7 @@ fn validate_no_node(
     },
     Err(ValidatePathInfoError::InvalidNodeName(
         "invalid".to_string(),
-        store_path::Error::InvalidName("".to_string())
+        store_path::Error::InvalidName(store_path::NameError::InvalidName("".to_string()))
     ));
     "invalid node name"
 )]
@@ -111,7 +111,7 @@ fn validate_directory(
     },
     Err(ValidatePathInfoError::InvalidNodeName(
         "invalid".to_string(),
-        store_path::Error::InvalidName("".to_string())
+        store_path::Error::InvalidName(store_path::NameError::InvalidName("".to_string()))
     ));
     "invalid node name"
 )]
@@ -141,7 +141,7 @@ fn validate_file(t_file_node: proto::FileNode, t_result: Result<StorePath, Valid
     },
     Err(ValidatePathInfoError::InvalidNodeName(
         "invalid".to_string(),
-        store_path::Error::InvalidName("".to_string())
+        store_path::Error::InvalidName(store_path::NameError::InvalidName("".to_string()))
     ));
     "invalid node name"
 )]