From ce36d1005569c09bca11910072af5b90522c45ee Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 20 Feb 2022 19:55:37 +0000 Subject: [PATCH] Begin factoring out the protocol code Use `nix::serve_proto::queryValidPaths`. --- src/hydra-queue-runner/build-remote.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index b0b54ac58..f6dd5a351 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -117,13 +117,11 @@ static void copyClosureTo(std::timed_mutex & sendMutex, Store & destStore, garbage-collect paths that are already there. Optionally, ask the remote host to substitute missing paths. */ // FIXME: substitute output pollutes our build log - conn.to << cmdQueryValidPaths << 1 << useSubstitutes; - worker_proto::write(destStore, conn.to, closure); - conn.to.flush(); - /* Get back the set of paths that are already valid on the remote host. */ - auto present = worker_proto::read(destStore, conn.from, Phantom {}); + auto present = serve_proto::queryValidPaths( + conn, destStore, + true, closure, useSubstitutes); if (present.size() == closure.size()) return;