about summary refs log tree commit diff
path: root/tvix/store/src/nar
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-07-18T16·37+0300
committerclbot <clbot@tvl.fyi>2023-07-21T19·01+0000
commit72e82ffcb11b1aaf1f1cc8db4189ced5ec0aa42e (patch)
treefbf51cd1d47df2f3341795fe6bcf8e0a95ccebef /tvix/store/src/nar
parent638f3e874d5eb6c157ffd065e593ee1a8a14d3e0 (diff)
refactor(tvix/store): use bytes for node names and symlink targets r/6436
Some paths might use names that are not valid UTF-8. We should be able
to represent them.

We don't actually need to touch the PathInfo structures, as they need to
represent StorePaths, which come with their own harder restrictions,
which can't encode non-UTF8 data.

While this doesn't change any of the wire format of the gRPC messages,
it does however change the interface of tvix_eval::EvalIO - its
read_dir() method does now return a list of Vec<u8>, rather than
SmolStr. Maybe this should be OsString instead?

Change-Id: I821016d9a58ec441ee081b0b9f01c9240723af0b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8974
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/nar')
-rw-r--r--tvix/store/src/nar/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tvix/store/src/nar/mod.rs b/tvix/store/src/nar/mod.rs
index 13e4f7bd93..84a48ba5f6 100644
--- a/tvix/store/src/nar/mod.rs
+++ b/tvix/store/src/nar/mod.rs
@@ -12,14 +12,14 @@ pub enum RenderError {
     #[error("failure talking to a backing store client: {0}")]
     StoreError(crate::Error),
 
-    #[error("unable to find directory {}, referred from {}", .0, .1)]
-    DirectoryNotFound(B3Digest, String),
+    #[error("unable to find directory {}, referred from {:?}", .0, .1)]
+    DirectoryNotFound(B3Digest, Vec<u8>),
 
-    #[error("unable to find blob {}, referred from {}", BASE64.encode(.0), .1)]
-    BlobNotFound([u8; 32], String),
+    #[error("unable to find blob {}, referred from {:?}", BASE64.encode(.0), .1)]
+    BlobNotFound([u8; 32], Vec<u8>),
 
-    #[error("unexpected size in metadata for blob {}, referred from {} returned, expected {}, got {}", BASE64.encode(.0), .1, .2, .3)]
-    UnexpectedBlobMeta([u8; 32], String, u32, u32),
+    #[error("unexpected size in metadata for blob {}, referred from {:?} returned, expected {}, got {}", BASE64.encode(.0), .1, .2, .3)]
+    UnexpectedBlobMeta([u8; 32], Vec<u8>, u32, u32),
 
     #[error("failure using the NAR writer: {0}")]
     NARWriterError(std::io::Error),