From 1b07e588c8dd8826ef2f3c6b40d31e3cf6ae405e Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 16 Jul 2020 21:04:40 -0400 Subject: feat(3p/nix/nix-daemon): Implement Worker::QuerySubstitutablePaths handler Change-Id: I243d67b0bce29d54c7d6e08f5eee70bd395cf9a2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1234 Tested-by: BuildkiteCI Reviewed-by: Kane York --- third_party/nix/src/nix-daemon/nix-daemon-proto.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'third_party/nix') diff --git a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc index 857d49b4b157..7344811eeac4 100644 --- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc +++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc @@ -167,6 +167,23 @@ class WorkerServiceImpl final : public WorkerService::Service { return Status::OK; } + Status QuerySubstitutablePaths(grpc::ServerContext* context, + const StorePaths* request, + StorePaths* response) override { + std::set paths; + for (const auto& path : request->paths()) { + paths.insert(path); + } + + auto res = store_->querySubstitutablePaths(paths); + + for (const auto& path : res) { + response->add_paths(path); + } + + return Status::OK; + } + Status QueryMissing(grpc::ServerContext* context, const StorePaths* request, nix::proto::QueryMissingResponse* response) override { std::set targets; -- cgit 1.4.1