From 6069b946ad3db5aa613f2691617fea8bd779c3ce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Dec 2016 17:19:00 +0100 Subject: [PATCH] nix-store --serve: Support setting build-repeat This allows Hydra to test whether builds are reproducible. --- src/nix-store/nix-store.cc | 2 ++ src/nix-store/serve-protocol.hh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 63e20a8c7..2e530ae52 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -840,6 +840,8 @@ static void opServe(Strings opFlags, Strings opArgs) settings.buildTimeout = readInt(in); if (GET_PROTOCOL_MINOR(clientVersion) >= 2) settings.maxLogSize = readInt(in); + if (GET_PROTOCOL_MINOR(clientVersion) >= 3) + settings.set("build-repeat", std::to_string(readInt(in))); }; while (true) { diff --git a/src/nix-store/serve-protocol.hh b/src/nix-store/serve-protocol.hh index c4e2a3703..f8cc9a4b6 100644 --- a/src/nix-store/serve-protocol.hh +++ b/src/nix-store/serve-protocol.hh @@ -5,7 +5,7 @@ namespace nix { #define SERVE_MAGIC_1 0x390c9deb #define SERVE_MAGIC_2 0x5452eecb -#define SERVE_PROTOCOL_VERSION 0x202 +#define SERVE_PROTOCOL_VERSION 0x203 #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)