From 89b629eeb18397f865600ff0d425c19ade0cfc72 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Jun 2015 17:37:35 +0200 Subject: [PATCH] Fix finishing steps that are not top-level of any build --- src/hydra-queue-runner/hydra-queue-runner.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index b2911559..18a59786 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -1119,7 +1119,8 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, } /* If there are no builds left to update in the DB, - then we're done. Delete the step from + then we're done (except for calling + finishBuildStep()). Delete the step from ‘steps’. Since we've been holding the ‘steps’ lock, no new referrers can have been added in the meantime or be added afterwards. */ @@ -1127,7 +1128,6 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, printMsg(lvlDebug, format("finishing build step ‘%1%’") % step->drvPath); nrStepsDone++; steps_->erase(step->drvPath); - break; } } @@ -1144,6 +1144,8 @@ bool State::doBuildStep(std::shared_ptr store, Step::ptr step, txn.commit(); } + if (direct.empty()) break; + /* Remove the direct dependencies from ‘builds’. This will cause them to be destroyed. */ for (auto & b : direct) {