diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-03-09 12:25:35 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-03-09 12:25:35 +0100 |
commit | 761242afa08d5c9280ba6bd63a310b4334b83bb2 (patch) | |
tree | 7509dfda4c52ecab6e972e3f1ed9d3b1d0360b5b /src/libstore/remote-store.cc | |
parent | a4604f19284254ac98f19a13ff7c2216de7fe176 (diff) |
BuildResult: Use DerivedPath
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index a0883db11..347e32094 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -93,7 +93,8 @@ void write(const Store & store, Sink & out, const DrvOutput & drvOutput) BuildResult read(const Store & store, Source & from, Phantom<BuildResult> _) { - BuildResult res; + auto path = worker_proto::read(store, from, Phantom<DerivedPath> {}); + BuildResult res { .path = path }; res.status = (BuildResult::Status) readInt(from); from >> res.errorMsg @@ -101,14 +102,13 @@ BuildResult read(const Store & store, Source & from, Phantom<BuildResult> _) >> res.isNonDeterministic >> res.startTime >> res.stopTime; - res.drvPath = worker_proto::read(store, from, Phantom<std::optional<StorePath>> {}); res.builtOutputs = worker_proto::read(store, from, Phantom<DrvOutputs> {}); - res.outPath = worker_proto::read(store, from, Phantom<std::optional<StorePath>> {}); return res; } void write(const Store & store, Sink & to, const BuildResult & res) { + worker_proto::write(store, to, res.path); to << res.status << res.errorMsg @@ -116,9 +116,7 @@ void write(const Store & store, Sink & to, const BuildResult & res) << res.isNonDeterministic << res.startTime << res.stopTime; - worker_proto::write(store, to, res.drvPath); worker_proto::write(store, to, res.builtOutputs); - worker_proto::write(store, to, res.outPath); } @@ -842,15 +840,16 @@ std::vector<BuildResult> RemoteStore::buildPathsWithResults( std::visit( overloaded { [&](const DerivedPath::Opaque & bo) { - BuildResult res; - res.status = BuildResult::Substituted; - res.outPath = bo.path; - results.push_back(res); + results.push_back(BuildResult { + .status = BuildResult::Substituted, + .path = bo, + }); }, [&](const DerivedPath::Built & bfd) { - BuildResult res; - res.status = BuildResult::Built; - res.drvPath = bfd.drvPath; + BuildResult res { + .status = BuildResult::Built, + .path = bfd, + }; OutputPathMap outputs; auto drv = evalStore->readDerivation(bfd.drvPath); @@ -905,7 +904,7 @@ BuildResult RemoteStore::buildDerivation(const StorePath & drvPath, const BasicD writeDerivation(conn->to, *this, drv); conn->to << buildMode; conn.processStderr(); - BuildResult res; + BuildResult res { .path = DerivedPath::Built { .drvPath = drvPath } }; res.status = (BuildResult::Status) readInt(conn->from); conn->from >> res.errorMsg; if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 29) { |