From fdd7817aad18346197a521593bdafdae4045aeb6 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 31 Dec 2023 18:54:44 +0200 Subject: feat(nix-compat/store_path): build_ca_path may fail Change-Id: Ia74ee870f38b7966501458bace541092256c3213 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10509 Reviewed-by: raitobezarius Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/glue/src/tvix_store_io.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tvix/glue/src/tvix_store_io.rs') diff --git a/tvix/glue/src/tvix_store_io.rs b/tvix/glue/src/tvix_store_io.rs index 41cae97ebf..5c255d5a30 100644 --- a/tvix/glue/src/tvix_store_io.rs +++ b/tvix/glue/src/tvix_store_io.rs @@ -326,7 +326,12 @@ async fn import_path_with_pathinfo( .to_str() .expect("path must be valid unicode"); - let output_path = store_path::build_nar_based_store_path(&nar_sha256, name); + let output_path = store_path::build_nar_based_store_path(&nar_sha256, name).map_err(|_| { + std::io::Error::new( + std::io::ErrorKind::InvalidData, + format!("invalid name: {}", name), + ) + })?; // assemble a new root_node with a name that is derived from the nar hash. let root_node = root_node.rename(output_path.to_string().into_bytes().into()); -- cgit 1.4.1