about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/nix-compat/src/nix_daemon/handler.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/tvix/nix-compat/src/nix_daemon/handler.rs b/tvix/nix-compat/src/nix_daemon/handler.rs
index a61a4810c807..65c5c2d60d08 100644
--- a/tvix/nix-compat/src/nix_daemon/handler.rs
+++ b/tvix/nix-compat/src/nix_daemon/handler.rs
@@ -5,7 +5,7 @@ use tokio::{
     io::{split, AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf},
     sync::Mutex,
 };
-use tracing::debug;
+use tracing::{debug, warn};
 
 use super::{
     types::QueryValidPaths,
@@ -146,6 +146,23 @@ where
                         let path: StorePath<String> = self.reader.read_value().await?;
                         self.handle(io.query_valid_derivers(&path)).await?
                     }
+                    // FUTUREWORK: These are just stubs that return an empty list.
+                    // It's important not to return an error for the local-overlay:// store
+                    // to work properly. While it will not see certain referrers and realizations
+                    // it will not fail on various operations like gc and optimize store. At the
+                    // same time, returning an empty list here shouldn't break any of local-overlay store's
+                    // invariants.
+                    Operation::QueryReferrers | Operation::QueryRealisation => {
+                        let _: String = self.reader.read_value().await?;
+                        self.handle(async move {
+                            warn!(
+                                ?operation,
+                                "This operation is not implemented. Returning empty result..."
+                            );
+                            Ok(Vec::<StorePath<String>>::new())
+                        })
+                        .await?
+                    }
                     _ => {
                         return Err(std::io::Error::other(format!(
                             "Operation {operation:?} is not implemented"