about summary refs log tree commit diff
path: root/tvix/nix-compat/src/store_path
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-31T16·54+0200
committerclbot <clbot@tvl.fyi>2024-01-01T00·52+0000
commitfdd7817aad18346197a521593bdafdae4045aeb6 (patch)
tree8fe76c1d68966eb88a7ca175a9038004eee9583c /tvix/nix-compat/src/store_path
parent20c98a51bf36ff6e74c4e62275ff31e7c43802c3 (diff)
feat(nix-compat/store_path): build_ca_path may fail r/7299
Change-Id: Ia74ee870f38b7966501458bace541092256c3213
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10509
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/store_path')
-rw-r--r--tvix/nix-compat/src/store_path/utils.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/nix-compat/src/store_path/utils.rs b/tvix/nix-compat/src/store_path/utils.rs
index af593d27affd..0b75ef50647c 100644
--- a/tvix/nix-compat/src/store_path/utils.rs
+++ b/tvix/nix-compat/src/store_path/utils.rs
@@ -115,14 +115,14 @@ pub fn build_ca_path<'a, S: AsRef<str>, I: IntoIterator<Item = S>>(
 }
 
 /// For given NAR sha256 digest and name, return the new [StorePathRef] this
-/// would have.
+/// would have, or an error, in case the name is invalid.
 pub fn build_nar_based_store_path<'a>(
     nar_sha256_digest: &[u8; 32],
     name: &'a str,
-) -> StorePathRef<'a> {
+) -> Result<StorePathRef<'a>, BuildStorePathError> {
     let nar_hash_with_mode = CAHash::Nar(NixHash::Sha256(nar_sha256_digest.to_owned()));
 
-    build_ca_path(name, &nar_hash_with_mode, Vec::<String>::new(), false).unwrap()
+    build_ca_path(name, &nar_hash_with_mode, Vec::<String>::new(), false)
 }
 
 /// This builds an input-addressed store path.