about summary refs log tree commit diff
path: root/tvix/store
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store')
-rw-r--r--tvix/store/src/fs/mod.rs7
-rw-r--r--tvix/store/src/pathinfoservice/memory.rs2
-rw-r--r--tvix/store/src/pathinfoservice/sled.rs5
-rw-r--r--tvix/store/src/proto/mod.rs4
4 files changed, 11 insertions, 7 deletions
diff --git a/tvix/store/src/fs/mod.rs b/tvix/store/src/fs/mod.rs
index 542f62667618..84de6ebe8de3 100644
--- a/tvix/store/src/fs/mod.rs
+++ b/tvix/store/src/fs/mod.rs
@@ -169,9 +169,10 @@ impl TvixStoreFs {
         } else {
             // If we don't have it, look it up in PathInfoService.
             let path_info_service = self.path_info_service.clone();
-            let task = self
-                .tokio_handle
-                .spawn(async move { path_info_service.get(store_path.digest).await });
+            let task = self.tokio_handle.spawn({
+                let digest = *store_path.digest();
+                async move { path_info_service.get(digest).await }
+            });
             match self.tokio_handle.block_on(task).unwrap()? {
                 // the pathinfo doesn't exist, so the file doesn't exist.
                 None => Ok(None),
diff --git a/tvix/store/src/pathinfoservice/memory.rs b/tvix/store/src/pathinfoservice/memory.rs
index dbb4b02dd013..d18453477a77 100644
--- a/tvix/store/src/pathinfoservice/memory.rs
+++ b/tvix/store/src/pathinfoservice/memory.rs
@@ -74,7 +74,7 @@ impl PathInfoService for MemoryPathInfoService {
             // This overwrites existing PathInfo objects.
             Ok(nix_path) => {
                 let mut db = self.db.write().unwrap();
-                db.insert(nix_path.digest, path_info.clone());
+                db.insert(*nix_path.digest(), path_info.clone());
 
                 Ok(path_info)
             }
diff --git a/tvix/store/src/pathinfoservice/sled.rs b/tvix/store/src/pathinfoservice/sled.rs
index bac384ea0912..fce0b7f44180 100644
--- a/tvix/store/src/pathinfoservice/sled.rs
+++ b/tvix/store/src/pathinfoservice/sled.rs
@@ -119,7 +119,10 @@ impl PathInfoService for SledPathInfoService {
             ))),
             // In case the PathInfo is valid, and we were able to extract a NixPath, store it in the database.
             // This overwrites existing PathInfo objects.
-            Ok(nix_path) => match self.db.insert(nix_path.digest, path_info.encode_to_vec()) {
+            Ok(nix_path) => match self
+                .db
+                .insert(*nix_path.digest(), path_info.encode_to_vec())
+            {
                 Ok(_) => Ok(path_info),
                 Err(e) => {
                     warn!("failed to insert PathInfo: {}", e);
diff --git a/tvix/store/src/proto/mod.rs b/tvix/store/src/proto/mod.rs
index 4b5bf4f59479..fe942ac2663e 100644
--- a/tvix/store/src/proto/mod.rs
+++ b/tvix/store/src/proto/mod.rs
@@ -130,12 +130,12 @@ impl PathInfo {
                     // This is safe, because we ensured the proper length earlier already.
                     let reference_digest = self.references[i].to_vec().try_into().unwrap();
 
-                    if reference_names_store_path.digest != reference_digest {
+                    if reference_names_store_path.digest() != &reference_digest {
                         return Err(
                             ValidatePathInfoError::InconsistentNarinfoReferenceNameDigest(
                                 i,
                                 reference_digest,
-                                reference_names_store_path.digest,
+                                *reference_names_store_path.digest(),
                             ),
                         );
                     }