about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/bin/tvix-store.rs7
-rw-r--r--tvix/store/src/import.rs4
2 files changed, 7 insertions, 4 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs
index 15f37d301f..1f172d65c6 100644
--- a/tvix/store/src/bin/tvix-store.rs
+++ b/tvix/store/src/bin/tvix-store.rs
@@ -5,6 +5,7 @@ use futures::future::try_join_all;
 use nix_compat::path_info::ExportedPathInfo;
 use serde::Deserialize;
 use serde::Serialize;
+use std::os::unix::ffi::OsStrExt;
 use std::path::PathBuf;
 use std::sync::Arc;
 use tokio_listener::Listener;
@@ -430,9 +431,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
                 }
 
                 let path: PathBuf = elem.path.to_absolute_path().into();
+                let root_name = path.file_name().unwrap().as_bytes().to_vec().into();
                 // Ingest the given path
-                let root_node =
-                    ingest_path(blob_service.clone(), directory_service.clone(), path).await?;
+                let root_node = ingest_path(blob_service.clone(), directory_service.clone(), &path)
+                    .await?
+                    .rename(root_name);
 
                 // Create and upload a PathInfo pointing to the root_node,
                 // annotated with information we have from the reference graph.
diff --git a/tvix/store/src/import.rs b/tvix/store/src/import.rs
index e6d451834c..5cff29a9e5 100644
--- a/tvix/store/src/import.rs
+++ b/tvix/store/src/import.rs
@@ -112,12 +112,12 @@ pub async fn import_path_as_nar_ca<BS, DS, PS, P>(
 ) -> Result<StorePath, std::io::Error>
 where
     P: AsRef<Path> + std::fmt::Debug,
-    BS: AsRef<dyn BlobService> + Clone,
+    BS: BlobService + Clone,
     DS: AsRef<dyn DirectoryService>,
     PS: AsRef<dyn PathInfoService>,
 {
     let root_node =
-        tvix_castore::import::ingest_path(blob_service, directory_service, &path).await?;
+        tvix_castore::import::ingest_path(blob_service, directory_service, path.as_ref()).await?;
 
     // Ask the PathInfoService for the NAR size and sha256
     let (nar_size, nar_sha256) = path_info_service.as_ref().calculate_nar(&root_node).await?;