From 72e82ffcb11b1aaf1f1cc8db4189ced5ec0aa42e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 18 Jul 2023 19:37:25 +0300 Subject: refactor(tvix/store): use bytes for node names and symlink targets 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, rather than SmolStr. Maybe this should be OsString instead? Change-Id: I821016d9a58ec441ee081b0b9f01c9240723af0b Reviewed-on: https://cl.tvl.fyi/c/depot/+/8974 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/vm/generators.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tvix/eval/src/vm/generators.rs') diff --git a/tvix/eval/src/vm/generators.rs b/tvix/eval/src/vm/generators.rs index fb60a45f20..3437136bde 100644 --- a/tvix/eval/src/vm/generators.rs +++ b/tvix/eval/src/vm/generators.rs @@ -10,7 +10,6 @@ use core::pin::Pin; use genawaiter::rc::Co; pub use genawaiter::rc::Gen; -use smol_str::SmolStr; use std::fmt::Display; use std::future::Future; @@ -187,7 +186,7 @@ pub enum VMResponse { Path(PathBuf), /// VM response with the contents of a directory. - Directory(Vec<(SmolStr, FileType)>), + Directory(Vec<(Vec, FileType)>), /// VM response with a span to use at the current point. Span(LightSpan), @@ -736,7 +735,7 @@ pub(crate) async fn request_path_exists(co: &GenCo, path: PathBuf) -> Value { } } -pub(crate) async fn request_read_dir(co: &GenCo, path: PathBuf) -> Vec<(SmolStr, FileType)> { +pub(crate) async fn request_read_dir(co: &GenCo, path: PathBuf) -> Vec<(Vec, FileType)> { match co.yield_(VMRequest::ReadDir(path)).await { VMResponse::Directory(dir) => dir, msg => panic!( -- cgit 1.4.1