about summary refs log tree commit diff
path: root/tvix/cli
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/cli
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/cli')
-rw-r--r--tvix/cli/src/nix_compat.rs3
-rw-r--r--tvix/cli/src/tvix_io.rs3
2 files changed, 2 insertions, 4 deletions
diff --git a/tvix/cli/src/nix_compat.rs b/tvix/cli/src/nix_compat.rs
index bda238983839..dbb67a9a1e43 100644
--- a/tvix/cli/src/nix_compat.rs
+++ b/tvix/cli/src/nix_compat.rs
@@ -11,7 +11,6 @@ use std::process::Command;
 use std::sync::RwLock;
 use std::{io, path::PathBuf};
 
-use smol_str::SmolStr;
 use tvix_eval::{EvalIO, FileType, StdIO};
 
 /// Compatibility implementation of [`EvalIO`] that uses C++ Nix to
@@ -78,7 +77,7 @@ impl EvalIO for NixCompatIO {
         self.underlying.read_to_string(path)
     }
 
-    fn read_dir(&self, path: &Path) -> Result<Vec<(SmolStr, FileType)>, io::Error> {
+    fn read_dir(&self, path: &Path) -> Result<Vec<(Vec<u8>, FileType)>, io::Error> {
         self.underlying.read_dir(path)
     }
 }
diff --git a/tvix/cli/src/tvix_io.rs b/tvix/cli/src/tvix_io.rs
index 8ca660f87b05..387a77b91966 100644
--- a/tvix/cli/src/tvix_io.rs
+++ b/tvix/cli/src/tvix_io.rs
@@ -9,7 +9,6 @@
 //! calculation will not work.
 
 use crate::KnownPaths;
-use smol_str::SmolStr;
 use std::cell::RefCell;
 use std::io;
 use std::path::{Path, PathBuf};
@@ -73,7 +72,7 @@ impl<T: EvalIO> EvalIO for TvixIO<T> {
         self.actual.read_to_string(path)
     }
 
-    fn read_dir(&self, path: &Path) -> Result<Vec<(SmolStr, FileType)>, io::Error> {
+    fn read_dir(&self, path: &Path) -> Result<Vec<(Vec<u8>, FileType)>, io::Error> {
         self.actual.read_dir(path)
     }
 }