about summary refs log tree commit diff
path: root/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-17T00·33-0400
committerglittershark <grfn@gws.fyi>2020-07-17T20·37+0000
commita67db573e5b06e10deb50f08a092a911b50c7a9c (patch)
tree3bbfb0cdf31d42b5e27386a2819ce418ada67cc9 /third_party/nix/src/nix-daemon/nix-daemon-proto.cc
parenteb4c8717cdeeaa93f24d2c3aeca075e6928d15e5 (diff)
feat(3p/nix/nix-daemon): Implement Worker::QueryDerivationOutputNames handler r/1356
Change-Id: Ie17e37322dd0e241cd35b6d8e69bd6c968fd6ff2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1231
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/nix/src/nix-daemon/nix-daemon-proto.cc')
-rw-r--r--third_party/nix/src/nix-daemon/nix-daemon-proto.cc13
1 files changed, 13 insertions, 0 deletions
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 178386730841..ef45fbd2a993 100644
--- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
+++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
@@ -1,4 +1,5 @@
 #include <google/protobuf/util/time_util.h>
+#include <grpcpp/impl/codegen/status.h>
 #include <grpcpp/impl/codegen/status_code_enum.h>
 
 #include "libproto/worker.grpc.pb.h"
@@ -128,6 +129,18 @@ class WorkerServiceImpl final : public WorkerService::Service {
     }
   }
 
+  Status QueryDerivationOutputNames(
+      grpc::ServerContext* context, const StorePath* request,
+      nix::proto::DerivationOutputNames* response) override {
+    auto path = request->path();
+    auto names = store_->queryDerivationOutputNames(path);
+    for (const auto& name : names) {
+      response->add_names(name);
+    }
+
+    return Status::OK;
+  }
+
   Status QueryMissing(grpc::ServerContext* context, const StorePaths* request,
                       nix::proto::QueryMissingResponse* response) override {
     std::set<Path> targets;