From d689b764f3f18ceab4de16720d9b120cb41ebd77 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 22 Nov 2025 12:30:18 -0500 Subject: [PATCH] Use `WorkerProto::Serialise` abstraction for `DrvOutput` It's better to consistently use the abstraction, rather than code which happens to do the same thing. See also d782c5e5863cdcfd3fc8013c84efa1053b3d2e80 for the same sort of change. --- src/libstore/daemon.cc | 4 ++-- src/libstore/remote-store.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 937946134..2a382dca7 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -964,7 +964,7 @@ static void performOp( case WorkerProto::Op::RegisterDrvOutput: { logger->startWork(); if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) { - auto outputId = DrvOutput::parse(readString(conn.from)); + auto outputId = WorkerProto::Serialise::read(*store, rconn); auto outputPath = StorePath(readString(conn.from)); store->registerDrvOutput(Realisation{{.outPath = outputPath}, outputId}); } else { @@ -977,7 +977,7 @@ static void performOp( case WorkerProto::Op::QueryRealisation: { logger->startWork(); - auto outputId = DrvOutput::parse(readString(conn.from)); + auto outputId = WorkerProto::Serialise::read(*store, rconn); auto info = store->queryRealisation(outputId); logger->stopWork(); if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) { diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 949a51f18..b07efc024 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -493,7 +493,7 @@ void RemoteStore::registerDrvOutput(const Realisation & info) auto conn(getConnection()); conn->to << WorkerProto::Op::RegisterDrvOutput; if (GET_PROTOCOL_MINOR(conn->protoVersion) < 31) { - conn->to << info.id.to_string(); + WorkerProto::write(*this, *conn, info.id); conn->to << std::string(info.outPath.to_string()); } else { WorkerProto::write(*this, *conn, info); @@ -513,7 +513,7 @@ void RemoteStore::queryRealisationUncached( } conn->to << WorkerProto::Op::QueryRealisation; - conn->to << id.to_string(); + WorkerProto::write(*this, *conn, id); conn.processStderr(); auto real = [&]() -> std::shared_ptr {