about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/rpc-store.cc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-09 r/1622 feat(tvix): Implement all remaining RPC callsGriffin Smith1-35/+62
Implement all remaining RPC calls on the RpcSstore client, remove a few stub methods we had added that weren't actually present in the old RemoteStore implementation, and add one more RPC call for getBuildLog that is present in the store API, but that we hadn't added as a stub *or* to the proto. Fixes: #29 Change-Id: Id827f51a393ece4bc7bbecaf38aee9eb4b329770 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1692 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-09 r/1621 refactor(tvix): Factor-out proto utilitiesGriffin Smith1-136/+47
Factor out the shared utilities for interacting with protobufs/grpc from libstore to a proto.hh header in libproto. Change-Id: I1cb8d94867d5d4b63a9994be0b53f8f612eb8e3a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1691 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-09 r/1620 feat(tvix): Pass function name to SuccessOrThrowGriffin Smith1-17/+28
To aid in debugging RPC call failures, pass the name of the function being called to the SuccessOrThrow util funcion in the RpcStore Change-Id: I523dacfab896b85a3dbe6050c07ee6bd5906fa44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1690 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-08 r/1615 feat(tvix): Implement AddToStoreNarGriffin Smith1-18/+42
Implement both the client and server sides of AddToStoreNar, using a templated generalization of the sources and sinks we were using for AddToStore on both ends. Change-Id: I73d0ed34118c711b125851dff99a7518ced4af35 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1686 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-05 r/1600 feat(3p/nix): Implement FindRoots, CollectGarbageGriffin Smith1-2/+27
Implement the RPC client and server handlers for the FindRoots and CollectGarbage RPC calls Change-Id: Ifa5d582c6a33bd1e7661ac2fc860505ef404dad0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1656 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-05 r/1594 feat(3p/nix): Implement AddToStore rpc clientGriffin Smith1-1/+51
Implement the AddToStore RPC client method, which uses an AddToStorePathWriterSink (the dual of the AddToStorePathReaderSource on the server side) to hook into the dumpPath machinery (which we should refactor not to use sinks or sources, but not yet) and write dumped paths as binary data over gRPC. With this commit and sandboxing disabled, the following derivation builds cleanly: derivation { name = "test"; builder = ./build.sh; system = "x86_64-linux"; } where build.sh has chmod +x and contains: #!/bin/sh echo 1 > $out Change-Id: I94cab86f0825a3a9993262a9807130645c13bf44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1638 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-04 r/1583 feat(tvix): Implement AddIndirectRoot, SyncWithGCGriffin Smith1-2/+7
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 <mail@tazj.in> Change-Id: I245dca0dfca882e2eae5d93364287a8b79fead71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1637 Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-04 r/1582 chore(tvix): Make not implemented errors nix::UnsupportedGriffin Smith1-22/+24
Without this, these errors print as "uncaught exception of type std::string", but with this they print using nix's built-in error printer, which will be nice to have as we bang out the remaining store API methods. Co-authored-by: Vincent Ambo <mail@tazj.in> Change-Id: I9bd4f77f65b27c8f97b727b98ef62e2061999e71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1636 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-08-04 r/1573 feat(3p/nix/daemon): catch-all explicit Error-Status conversionKane York1-3/+95
We wrap every server-side proto handler with a macro that catches exceptions and turns them into proper grpc error codes. For the time being, most exceptions map to INTERNAL, the existing mapping. Change-Id: Id6ed6a279b198ad185d32562f39000ccc15eadbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/1599 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-03 r/1567 feat(3p/nix): Implement two more RPC callsGriffin Smith1-3/+24
Implement AddTextToStore and BuildPaths both on the client and the server Refs: #29 Change-Id: I45294c3e1c1a7489e42099d36425b7acc04e0427 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1560 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-02 r/1540 fix(3p/nix): Don't reuse ClientContextGriffin Smith1-1/+11
It turns out these aren't supposed to be reused after the first request - reusing it was causing things to blow up. Change-Id: I935f1ee82ed4e7f26528ae105c8fa2501fa81b97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1559 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-02 r/1538 fix(3p/nix): Prepend unix:// to daemon socketGriffin Smith1-2/+3
Prepend the unix:// URI scheme to the daemon socket so that grpc knows we want to connect to a unix socket rather than another type of URI. As part of debugging this I made the failure message for the RPCStore include the URI, which I'm leaving in since it'll be nice to have. Change-Id: I6e70596895117b9a0d53fe2a61d8542ceb64c940 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1543 Reviewed-by: kanepyork <rikingcoding@gmail.com> Tested-by: BuildkiteCI
2020-08-01 r/1529 feat(3p/nix): Implement a few more RPC callsGriffin Smith1-3/+32
Implement the RPC client calls for QueryPathFromHashPart, QuerySubstitutablePaths, and QuerySubstitutablePathInfos, and the handler for QuerySubstitutablePathInfos. Refs: #29 Change-Id: Idf383b771f159f267d8f65367bc4af3d239e32b7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1515 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-01 r/1515 chore(3p/nix/hash): prefer StatusOr over throwing constructorKane York1-1/+2
The use of `unwrap_throw` can be used as a later grep target. Change-Id: I8c54ed90c4289f07aecb8a1393dd10204c8bce4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1493 Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-07-25 r/1473 feat(3p/nix): Start implementing RPC store clientGriffin Smith1-0/+282
Add a stub class for wrapping a gRPC client to the new, proto-backed nix store protocol, along with several methods implemented but several left throwing a not implemented exception. Paired-With: Vincent Ambo <mail@tazj.in> Paired-With: Perry Lorier <isomer@tvl.fyi> Change-Id: Id943d4f6d75084b8498786d580e6c9f7c92c104d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1436 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>