From a17282fc66acac590d5a0923c97b8c61933a7f11 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 24 May 2024 20:45:05 -0600 Subject: [PATCH] Set up minimum protocol version Change-Id: Ibb931109a8328cfb22964542ab53644cc4181f9e --- src/libstore/worker-protocol.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index dcd54ad16..cc083a551 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -9,7 +9,16 @@ namespace nix { #define WORKER_MAGIC_1 0x6e697863 #define WORKER_MAGIC_2 0x6478696f +// This must remain 1.35 (Nix 2.18) forever in Lix, since the protocol has +// diverged in CppNix such that we cannot assign newer versions ourselves, the +// protocol is bad in design and implementation and Lix intends to replace it +// entirely. #define PROTOCOL_VERSION (1 << 8 | 35) +// Nix 2.3 is protocol 1.21 (see RemoteStore::initConnection for client, +// processConnection for server). +#define MIN_SUPPORTED_MINOR_WORKER_PROTO_VERSION 21 +#define MIN_SUPPORTED_WORKER_PROTO_VERSION (1 << 8 | MIN_SUPPORTED_MINOR_WORKER_PROTO_VERSION) + #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)