diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 1fdd5a23..659618b7 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -203,7 +203,9 @@ static std::pair openLogFile(const std::string & logDir, cons */ static void handshake(Machine::Connection & conn, unsigned int repeats) { - conn.to << SERVE_MAGIC_1 << 0x206; + constexpr ServeProto::Version our_version = 0x206; + + conn.to << SERVE_MAGIC_1 << our_version; conn.to.flush(); unsigned int magic = readInt(conn.from); @@ -215,6 +217,9 @@ static void handshake(Machine::Connection & conn, unsigned int repeats) throw Error("unsupported ‘nix-store --serve’ protocol version on ‘%1%’", conn.machine->sshName); if (GET_PROTOCOL_MINOR(conn.remoteVersion) < 3 && repeats > 0) throw Error("machine ‘%1%’ does not support repeating a build; please upgrade it to Nix 1.12", conn.machine->sshName); + + // Do not attempt to speak a newer version of the protocol + conn.remoteVersion = std::min(conn.remoteVersion, our_version); } static BasicDerivation sendInputs(