aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/worker.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-29 21:06:30 +0200
committereldritch horrors <pennae@lix.systems>2024-08-30 10:18:28 +0000
commit869666cb651f97cdce3a6aabf62073bfe1130cbb (patch)
treed9c2c67742d15eca4e44b6b6da5a5bb09fa2d94f /src/libstore/build/worker.cc
parenta5c1e73fa8e004a93e37254a3582ba91048c4550 (diff)
libstore: hide Worker goal factory methods
this doesn't serve a great purpose yet except to confine construction of goals to the stack frame of Worker::run() and its child frames. we don't need this yet (and the goal constructors remain fully visible), but in a future change that fully removes the current worker loop we'll need some way of knowing which goals are top-level goals without passing the goals themselves around. once that's possible we can remove visible goals as a concept and rely on build result futures and a scheduler built upon them Change-Id: Ia73cdeffcfb9ba1ce9d69b702dc0bc637a4c4ce6
Diffstat (limited to 'src/libstore/build/worker.cc')
-rw-r--r--src/libstore/build/worker.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index 9e548cc16..5d0cc920a 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -326,8 +326,9 @@ void Worker::waitForAWhile(GoalPtr goal)
}
-void Worker::run(const Goals & _topGoals)
+Goals Worker::run(std::function<Goals (GoalFactory &)> req)
{
+ auto _topGoals = req(goalFactory());
std::vector<nix::DerivedPath> topPaths;
assert(!running);
@@ -411,6 +412,8 @@ void Worker::run(const Goals & _topGoals)
assert(!settings.keepGoing || awake.empty());
assert(!settings.keepGoing || wantingToBuild.empty());
assert(!settings.keepGoing || children.empty());
+
+ return _topGoals;
}
void Worker::waitForInput()