diff options
-rw-r--r-- | tvix/castore/src/import/archive.rs | 4 | ||||
-rw-r--r-- | tvix/castore/src/import/fs.rs | 5 | ||||
-rw-r--r-- | tvix/castore/src/import/mod.rs | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tvix/castore/src/import/archive.rs b/tvix/castore/src/import/archive.rs index b13716f54f7f..a3f63be49098 100644 --- a/tvix/castore/src/import/archive.rs +++ b/tvix/castore/src/import/archive.rs @@ -150,7 +150,9 @@ where target: entry .link_name()? .ok_or_else(|| Error::MissingSymlinkTarget(path.clone()))? - .into(), + .into_owned() + .into_os_string() + .into_encoded_bytes(), path, }, // Push a bogus directory marker so we can make sure this directoy gets diff --git a/tvix/castore/src/import/fs.rs b/tvix/castore/src/import/fs.rs index 03a52f2ba073..5e7061bec66d 100644 --- a/tvix/castore/src/import/fs.rs +++ b/tvix/castore/src/import/fs.rs @@ -2,6 +2,7 @@ use futures::stream::BoxStream; use futures::StreamExt; +use std::os::unix::ffi::OsStringExt; use std::os::unix::fs::MetadataExt; use std::os::unix::fs::PermissionsExt; use std::path::Path; @@ -108,7 +109,9 @@ where Ok(IngestionEntry::Dir { path }) } else if file_type.is_symlink() { let target = std::fs::read_link(entry.path()) - .map_err(|e| Error::UnableToStat(entry.path().to_path_buf(), e))?; + .map_err(|e| Error::UnableToStat(entry.path().to_path_buf(), e))? + .into_os_string() + .into_vec(); Ok(IngestionEntry::Symlink { path, target }) } else if file_type.is_file() { diff --git a/tvix/castore/src/import/mod.rs b/tvix/castore/src/import/mod.rs index e9fdc750f8c1..e77eda255fbf 100644 --- a/tvix/castore/src/import/mod.rs +++ b/tvix/castore/src/import/mod.rs @@ -114,7 +114,7 @@ where } IngestionEntry::Symlink { ref target, .. } => Node::Symlink(SymlinkNode { name, - target: target.as_os_str().as_bytes().to_owned().into(), + target: target.to_owned().into(), }), IngestionEntry::Regular { size, @@ -209,7 +209,7 @@ pub enum IngestionEntry { }, Symlink { path: PathBuf, - target: PathBuf, + target: Vec<u8>, }, Dir { path: PathBuf, |