diff options
author | eldritch horrors <pennae@lix.systems> | 2024-10-05 00:38:35 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-10-05 19:06:59 +0000 |
commit | 7ef44660181b5c9743475ea73bc2e87a5f1d318f (patch) | |
tree | 79986e03e6147aeecdfa405e238ceb6143294257 /src/libstore/build/worker.cc | |
parent | a9f2aab22612bea940aa79cfb2eb15cc650ff869 (diff) |
libstore: have goals promise WorkResults, not void
Change-Id: Idd218ec1572eda84dc47accc0dcd8a954d36f098
Diffstat (limited to 'src/libstore/build/worker.cc')
-rw-r--r-- | src/libstore/build/worker.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index e90f17678..839b56bc8 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -53,7 +53,7 @@ Worker::~Worker() template<typename ID, std::derived_from<Goal> G> -std::pair<std::shared_ptr<G>, kj::Promise<void>> Worker::makeGoalCommon( +std::pair<std::shared_ptr<G>, kj::Promise<Result<Goal::WorkResult>>> Worker::makeGoalCommon( std::map<ID, CachedGoal<G>> & map, const ID & key, InvocableR<std::unique_ptr<G>> auto create, @@ -89,7 +89,7 @@ std::pair<std::shared_ptr<G>, kj::Promise<void>> Worker::makeGoalCommon( } -std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<void>> Worker::makeDerivationGoal( +std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<Result<Goal::WorkResult>>> Worker::makeDerivationGoal( const StorePath & drvPath, const OutputsSpec & wantedOutputs, BuildMode buildMode ) { @@ -110,7 +110,7 @@ std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<void>> Worker::makeDeriva } -std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<void>> Worker::makeBasicDerivationGoal( +std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<Result<Goal::WorkResult>>> Worker::makeBasicDerivationGoal( const StorePath & drvPath, const BasicDerivation & drv, const OutputsSpec & wantedOutputs, @@ -134,7 +134,7 @@ std::pair<std::shared_ptr<DerivationGoal>, kj::Promise<void>> Worker::makeBasicD } -std::pair<std::shared_ptr<PathSubstitutionGoal>, kj::Promise<void>> +std::pair<std::shared_ptr<PathSubstitutionGoal>, kj::Promise<Result<Goal::WorkResult>>> Worker::makePathSubstitutionGoal( const StorePath & path, RepairFlag repair, std::optional<ContentAddress> ca ) @@ -148,7 +148,7 @@ Worker::makePathSubstitutionGoal( } -std::pair<std::shared_ptr<DrvOutputSubstitutionGoal>, kj::Promise<void>> +std::pair<std::shared_ptr<DrvOutputSubstitutionGoal>, kj::Promise<Result<Goal::WorkResult>>> Worker::makeDrvOutputSubstitutionGoal( const DrvOutput & id, RepairFlag repair, std::optional<ContentAddress> ca ) @@ -162,16 +162,16 @@ Worker::makeDrvOutputSubstitutionGoal( } -std::pair<GoalPtr, kj::Promise<void>> Worker::makeGoal(const DerivedPath & req, BuildMode buildMode) +std::pair<GoalPtr, kj::Promise<Result<Goal::WorkResult>>> Worker::makeGoal(const DerivedPath & req, BuildMode buildMode) { return std::visit(overloaded { - [&](const DerivedPath::Built & bfd) -> std::pair<GoalPtr, kj::Promise<void>> { + [&](const DerivedPath::Built & bfd) -> std::pair<GoalPtr, kj::Promise<Result<Goal::WorkResult>>> { if (auto bop = std::get_if<DerivedPath::Opaque>(&*bfd.drvPath)) return makeDerivationGoal(bop->path, bfd.outputs, buildMode); else throw UnimplementedError("Building dynamic derivations in one shot is not yet implemented."); }, - [&](const DerivedPath::Opaque & bo) -> std::pair<GoalPtr, kj::Promise<void>> { + [&](const DerivedPath::Opaque & bo) -> std::pair<GoalPtr, kj::Promise<Result<Goal::WorkResult>>> { return makePathSubstitutionGoal(bo.path, buildMode == bmRepair ? Repair : NoRepair); }, }, req.raw()); |