From 38f550708dd01515f7aaf66b0cc548fcd701e1c0 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 11 Aug 2024 01:37:40 +0200 Subject: libstore: add explicit in-build-slot-ness to goals we don't need to expose information about how busy a Worker is if the worker can instead tell its work items whether they are in a slot. in the future we might use this to not start items waiting for a slot if no slots are currently available, but that requires more preparation. Change-Id: Ibe01ac536da7e6d6f80520164117c43e772f9bd9 --- src/libstore/build/derivation-goal.hh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/libstore/build/derivation-goal.hh') diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/build/derivation-goal.hh index 257282308..250b437da 100644 --- a/src/libstore/build/derivation-goal.hh +++ b/src/libstore/build/derivation-goal.hh @@ -191,7 +191,7 @@ struct DerivationGoal : public Goal */ std::optional derivationType; - typedef WorkResult (DerivationGoal::*GoalState)(); + typedef WorkResult (DerivationGoal::*GoalState)(bool inBuildSlot); GoalState state; BuildMode buildMode; @@ -224,7 +224,7 @@ struct DerivationGoal : public Goal std::string key() override; - WorkResult work() override; + WorkResult work(bool inBuildSlot) override; /** * Add wanted outputs to an already existing derivation goal. @@ -234,23 +234,23 @@ struct DerivationGoal : public Goal /** * The states. */ - WorkResult getDerivation(); - WorkResult loadDerivation(); - WorkResult haveDerivation(); - WorkResult outputsSubstitutionTried(); - WorkResult gaveUpOnSubstitution(); - WorkResult closureRepaired(); - WorkResult inputsRealised(); - WorkResult tryToBuild(); - virtual WorkResult tryLocalBuild(); - WorkResult buildDone(); + WorkResult getDerivation(bool inBuildSlot); + WorkResult loadDerivation(bool inBuildSlot); + WorkResult haveDerivation(bool inBuildSlot); + WorkResult outputsSubstitutionTried(bool inBuildSlot); + WorkResult gaveUpOnSubstitution(bool inBuildSlot); + WorkResult closureRepaired(bool inBuildSlot); + WorkResult inputsRealised(bool inBuildSlot); + WorkResult tryToBuild(bool inBuildSlot); + virtual WorkResult tryLocalBuild(bool inBuildSlot); + WorkResult buildDone(bool inBuildSlot); - WorkResult resolvedFinished(); + WorkResult resolvedFinished(bool inBuildSlot); /** * Is the build hook willing to perform the build? */ - HookReply tryBuildHook(); + HookReply tryBuildHook(bool inBuildSlot); virtual int getChildStatus(); -- cgit v1.2.3