diff options
author | eldritch horrors <pennae@lix.systems> | 2024-07-09 23:14:46 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-07-11 21:31:52 +0000 |
commit | 4b109ec1a8fc4550150f56f0f46f2f41d844bda8 (patch) | |
tree | 36e924ef4097521b7c8ba6aceacc427acb133819 /src/libstore/build/derivation-goal.cc | |
parent | a5d431a9119c2560608768d9ec70fa37d5a6a985 (diff) |
libstore: remove upcast_goal
upcast_goal was only ever needed to break circular includes, but the
same solution that gave us upcast_goal also lets us fully remove it:
just upcast goals without a wrapper function, but only in .cc files.
Change-Id: I9c71654b2535121459ba7dcfd6c5da5606904032
Diffstat (limited to 'src/libstore/build/derivation-goal.cc')
-rw-r--r-- | src/libstore/build/derivation-goal.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 7c18f8b60..51597428d 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -12,6 +12,8 @@ #include "topo-sort.hh" #include "local-store.hh" // TODO remove, along with remaining downcasts #include "logging-json.hh" +#include "substitution-goal.hh" +#include "drv-output-substitution-goal.hh" #include <regex> #include <queue> @@ -175,7 +177,7 @@ void DerivationGoal::getDerivation() return; } - addWaitee(upcast_goal(worker.makePathSubstitutionGoal(drvPath))); + addWaitee(worker.makePathSubstitutionGoal(drvPath)); state = &DerivationGoal::loadDerivation; } @@ -276,19 +278,17 @@ void DerivationGoal::haveDerivation() if (!status.wanted) continue; if (!status.known) addWaitee( - upcast_goal( - worker.makeDrvOutputSubstitutionGoal( - DrvOutput{status.outputHash, outputName}, - buildMode == bmRepair ? Repair : NoRepair - ) + worker.makeDrvOutputSubstitutionGoal( + DrvOutput{status.outputHash, outputName}, + buildMode == bmRepair ? Repair : NoRepair ) ); else { auto * cap = getDerivationCA(*drv); - addWaitee(upcast_goal(worker.makePathSubstitutionGoal( + addWaitee(worker.makePathSubstitutionGoal( status.known->path, buildMode == bmRepair ? Repair : NoRepair, - cap ? std::optional { *cap } : std::nullopt))); + cap ? std::optional { *cap } : std::nullopt)); } } @@ -426,7 +426,7 @@ void DerivationGoal::gaveUpOnSubstitution() if (!settings.useSubstitutes) throw Error("dependency '%s' of '%s' does not exist, and substitution is disabled", worker.store.printStorePath(i), worker.store.printStorePath(drvPath)); - addWaitee(upcast_goal(worker.makePathSubstitutionGoal(i))); + addWaitee(worker.makePathSubstitutionGoal(i)); } if (waitees.empty()) /* to prevent hang (no wake-up event) */ @@ -479,7 +479,7 @@ void DerivationGoal::repairClosure() worker.store.printStorePath(i), worker.store.printStorePath(drvPath)); auto drvPath2 = outputsToDrv.find(i); if (drvPath2 == outputsToDrv.end()) - addWaitee(upcast_goal(worker.makePathSubstitutionGoal(i, Repair))); + addWaitee(worker.makePathSubstitutionGoal(i, Repair)); else addWaitee(worker.makeGoal( DerivedPath::Built { |