From 5feed69260d966d2b38050160ccdcd794d8e6c75 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 3 Aug 2020 22:32:53 -0400 Subject: feat(tvix): Implement AddIndirectRoot, SyncWithGC Implement RPC handlers and client methods for the AddWithRoot and SyncWithGC calls. With this and sandboxing disabled, the following derivation is now building successfully: derivation { name = "test"; builder = "/bin/sh"; args = [ "-c" "echo 1 > $out" ]; system = "x86_64-linux"; } Co-authored-by: Vincent Ambo Change-Id: I245dca0dfca882e2eae5d93364287a8b79fead71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1637 Reviewed-by: tazjin Reviewed-by: kanepyork Tested-by: BuildkiteCI --- third_party/nix/src/libstore/rpc-store.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libstore') diff --git a/third_party/nix/src/libstore/rpc-store.cc b/third_party/nix/src/libstore/rpc-store.cc index 5a0a2c98969a..f0abdd42efa9 100644 --- a/third_party/nix/src/libstore/rpc-store.cc +++ b/third_party/nix/src/libstore/rpc-store.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include "libproto/worker.grpc.pb.h" #include "libproto/worker.pb.h" @@ -355,11 +356,15 @@ void RpcStore::addTempRoot(const Path& path) { } void RpcStore::addIndirectRoot(const Path& path) { - throw Unsupported(absl::StrCat("Not implemented ", __func__)); + ClientContext ctx; + google::protobuf::Empty response; + SuccessOrThrow(stub_->AddIndirectRoot(&ctx, StorePath(path), &response)); } void RpcStore::syncWithGC() { - throw Unsupported(absl::StrCat("Not implemented ", __func__)); + ClientContext ctx; + google::protobuf::Empty response; + SuccessOrThrow(stub_->SyncWithGC(&ctx, kEmpty, &response)); } Roots RpcStore::findRoots(bool censor) { -- cgit 1.4.1