mirror of
https://github.com/NixOS/nix
synced 2025-06-30 11:43:15 +02:00
Worker proto use proper serialiser for BuildMode
Do this instead of an unchecked cast I redid this to use the serialisation framework (including a unit test), but I am keeping the reference to credit Jade for spotting the issue. Change-Id: Icf6af7935e8f139bef36b40ad475e973aa48855c (adapted from commit 2a7a824d83dc5fb33326b8b89625685f283a743b) Co-Authored-By: Jade Lovelace <lix@jade.fyi>
This commit is contained in:
parent
7de033d63f
commit
eeb89c28b0
6 changed files with 46 additions and 4 deletions
|
@ -531,7 +531,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||
auto drvs = WorkerProto::Serialise<DerivedPaths>::read(*store, rconn);
|
||||
BuildMode mode = bmNormal;
|
||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 15) {
|
||||
mode = (BuildMode) readInt(from);
|
||||
mode = WorkerProto::Serialise<BuildMode>::read(*store, rconn);
|
||||
|
||||
/* Repairing is not atomic, so disallowed for "untrusted"
|
||||
clients.
|
||||
|
@ -555,7 +555,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||
case WorkerProto::Op::BuildPathsWithResults: {
|
||||
auto drvs = WorkerProto::Serialise<DerivedPaths>::read(*store, rconn);
|
||||
BuildMode mode = bmNormal;
|
||||
mode = (BuildMode) readInt(from);
|
||||
mode = WorkerProto::Serialise<BuildMode>::read(*store, rconn);
|
||||
|
||||
/* Repairing is not atomic, so disallowed for "untrusted"
|
||||
clients.
|
||||
|
@ -586,7 +586,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||
* correctly.
|
||||
*/
|
||||
readDerivation(from, *store, drv, Derivation::nameFromPath(drvPath));
|
||||
BuildMode buildMode = (BuildMode) readInt(from);
|
||||
auto buildMode = WorkerProto::Serialise<BuildMode>::read(*store, rconn);
|
||||
logger->startWork();
|
||||
|
||||
auto drvType = drv.type();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue