aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-05-24 20:45:05 -0600
committerJade Lovelace <lix@jade.fyi>2024-06-16 19:13:51 -0700
commita17282fc66acac590d5a0923c97b8c61933a7f11 (patch)
treec4d9d2f4421854f1285021f87c41cc7f7df74064 /src/libstore
parent6c541e0bef55b2f1ed1678a2fd5da72acbbcb180 (diff)
Set up minimum protocol version
Change-Id: Ibb931109a8328cfb22964542ab53644cc4181f9e
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/worker-protocol.hh9
1 files changed, 9 insertions, 0 deletions
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)