1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-25 03:39:36 +01:00

Merge pull request #14631 from obsidiansystems/use-serialisation-abstraction

Use `WorkerProto::Serialise` abstraction for `DrvOutput`
This commit is contained in:
John Ericson 2025-11-24 16:33:18 +00:00 committed by GitHub
commit c7b61f3d13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -964,7 +964,7 @@ static void performOp(
case WorkerProto::Op::RegisterDrvOutput: { case WorkerProto::Op::RegisterDrvOutput: {
logger->startWork(); logger->startWork();
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) { if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {
auto outputId = DrvOutput::parse(readString(conn.from)); auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
auto outputPath = StorePath(readString(conn.from)); auto outputPath = StorePath(readString(conn.from));
store->registerDrvOutput(Realisation{{.outPath = outputPath}, outputId}); store->registerDrvOutput(Realisation{{.outPath = outputPath}, outputId});
} else { } else {
@ -977,7 +977,7 @@ static void performOp(
case WorkerProto::Op::QueryRealisation: { case WorkerProto::Op::QueryRealisation: {
logger->startWork(); logger->startWork();
auto outputId = DrvOutput::parse(readString(conn.from)); auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
auto info = store->queryRealisation(outputId); auto info = store->queryRealisation(outputId);
logger->stopWork(); logger->stopWork();
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) { if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {

View file

@ -493,7 +493,7 @@ void RemoteStore::registerDrvOutput(const Realisation & info)
auto conn(getConnection()); auto conn(getConnection());
conn->to << WorkerProto::Op::RegisterDrvOutput; conn->to << WorkerProto::Op::RegisterDrvOutput;
if (GET_PROTOCOL_MINOR(conn->protoVersion) < 31) { 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()); conn->to << std::string(info.outPath.to_string());
} else { } else {
WorkerProto::write(*this, *conn, info); WorkerProto::write(*this, *conn, info);
@ -513,7 +513,7 @@ void RemoteStore::queryRealisationUncached(
} }
conn->to << WorkerProto::Op::QueryRealisation; conn->to << WorkerProto::Op::QueryRealisation;
conn->to << id.to_string(); WorkerProto::write(*this, *conn, id);
conn.processStderr(); conn.processStderr();
auto real = [&]() -> std::shared_ptr<const UnkeyedRealisation> { auto real = [&]() -> std::shared_ptr<const UnkeyedRealisation> {