feat(3p/nix): Add main function for grpc daemon
Implement the main function for the new, proto-based nix daemon. This mostly replicates the behavior of the previous nix daemon - it starts a grpc server listening on the same nix socket path and supports the same set of options - with the exception of --stdio, which has been renamed to --pipe and documented in the man page. Change-Id: Ib729283c1d5d35c0e1b0a968bc1f052f5527f2d7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1356 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
parent
7c56fccdad
commit
dcaba9de64
10 changed files with 174 additions and 14 deletions
4
third_party/nix/src/libstore/derivations.cc
vendored
4
third_party/nix/src/libstore/derivations.cc
vendored
|
|
@ -31,11 +31,11 @@ void DerivationOutput::parseHashInfo(bool& recursive, Hash& hash) const {
|
|||
}
|
||||
|
||||
BasicDerivation BasicDerivation::from_proto(
|
||||
const nix::proto::Derivation* proto_derivation, const nix::Store* store) {
|
||||
const nix::proto::Derivation* proto_derivation, const nix::Store& store) {
|
||||
BasicDerivation result;
|
||||
result.platform = proto_derivation->platform();
|
||||
result.builder = proto_derivation->builder().path();
|
||||
store->assertStorePath(result.builder);
|
||||
store.assertStorePath(result.builder);
|
||||
|
||||
result.outputs.insert(proto_derivation->outputs().begin(),
|
||||
proto_derivation->outputs().end());
|
||||
|
|
|
|||
2
third_party/nix/src/libstore/derivations.hh
vendored
2
third_party/nix/src/libstore/derivations.hh
vendored
|
|
@ -59,7 +59,7 @@ struct BasicDerivation {
|
|||
// Convert the given proto derivation to a BasicDerivation in the given
|
||||
// nix::Store.
|
||||
static BasicDerivation from_proto(
|
||||
const nix::proto::Derivation* proto_derivation, const nix::Store* store);
|
||||
const nix::proto::Derivation* proto_derivation, const nix::Store& store);
|
||||
|
||||
virtual ~BasicDerivation(){};
|
||||
|
||||
|
|
|
|||
2
third_party/nix/src/libstore/ssh-store.cc
vendored
2
third_party/nix/src/libstore/ssh-store.cc
vendored
|
|
@ -67,7 +67,7 @@ ref<FSAccessor> SSHStore::getFSAccessor() {
|
|||
|
||||
ref<RemoteStore::Connection> SSHStore::openConnection() {
|
||||
auto conn = make_ref<Connection>();
|
||||
conn->sshConn = master.startCommand("nix-daemon --stdio");
|
||||
conn->sshConn = master.startCommand("nix-daemon --pipe");
|
||||
conn->to = FdSink(conn->sshConn->in.get());
|
||||
conn->from = FdSource(conn->sshConn->out.get());
|
||||
initConnection(*conn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue