diff --git a/lix/libstore/daemon.capnp b/lix/libstore/daemon.capnp index 2c9a9999c..a74860c29 100644 --- a/lix/libstore/daemon.capnp +++ b/lix/libstore/daemon.capnp @@ -28,10 +28,6 @@ interface Protocol { # TODO maybe add information or something } -# legacy boot protocol. EXPLICITLY UNSTABLE, this id will change frequently and without notice. -# every change to the experimental tunneling protocol may also change this protocol identifier. -const unstableLegacyTunneled :Text = "lix/legacy/ba3153c5-4153-4d66-91ec-a258c02e9a3c"; - interface LegacyBoot extends(Protocol) $T.throws(T.v1Errors) { enum Trust { unknown @0; diff --git a/lix/libstore/daemon.cc b/lix/libstore/daemon.cc index dec3750cf..5a1163f03 100644 --- a/lix/libstore/daemon.cc +++ b/lix/libstore/daemon.cc @@ -32,6 +32,8 @@ #include #include +const std::string nix::rpc::daemon::UNSTABLE_LEGACY_TUNNELED = "lix/legacy/" PACKAGE_VERSION; + namespace nix::daemon { Sink & operator << (Sink & sink, const Logger::Fields & fields) diff --git a/lix/libstore/daemon.hh b/lix/libstore/daemon.hh index 478b299c2..133a50e6c 100644 --- a/lix/libstore/daemon.hh +++ b/lix/libstore/daemon.hh @@ -6,6 +6,12 @@ #include "lix/libstore/store-api.hh" #include +namespace nix::rpc::daemon { +// legacy boot protocol. EXPLICITLY UNSTABLE, this id will change frequently and without notice. +// every change to the experimental tunneling protocol may also change this protocol identifier. +extern const std::string UNSTABLE_LEGACY_TUNNELED; +} + namespace nix::daemon { void processLegacyConnection( diff --git a/lix/libstore/uds-remote-store.cc b/lix/libstore/uds-remote-store.cc index 304487336..f26baf3e3 100644 --- a/lix/libstore/uds-remote-store.cc +++ b/lix/libstore/uds-remote-store.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -184,7 +185,7 @@ try { auto supportedProtos = supported.getProtocols(); debug("remote advertised %s", supported.toString().flatten().cStr()); if (supportedProtos.size() != 1 - && supportedProtos[0].getId() != rpc::daemon::UNSTABLE_LEGACY_TUNNELED) + && rpc::to(supportedProtos[0].getId()) != rpc::daemon::UNSTABLE_LEGACY_TUNNELED) { co_return false; } @@ -201,7 +202,7 @@ try { auto bootstrapReq = bootstrap.requestRequest(); bootstrapReq.setClientInfo(PACKAGE_STRING); - bootstrapReq.setProtocol(rpc::daemon::UNSTABLE_LEGACY_TUNNELED); + RPC_FILL(bootstrapReq, setProtocol, rpc::daemon::UNSTABLE_LEGACY_TUNNELED); auto legacyBoot = TRY_AWAIT_RPC_NOEXCEPT(bootstrapReq.send()).getResult().castAs(); auto initReq = legacyBoot.initRequest();