-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Remove multiple entrypoints into Goal code #12668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Worked around |
My bug! Clang just didn't trigger it. |
aac0ed7
to
78d0faa
Compare
59e89ba
to
4041b24
Compare
unsigned long & logSize, | ||
std::string & currentLogLine, | ||
size_t & currentLogLinePos, | ||
std::list<std::string> & logTail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of function arguments. Maybe this could be moved into a struct? (Possibly in a future PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edolstra I think the end game is just to move the closure inline, and all of this stuff can just become captures, not arguments to a builder function.
6081257
to
53a81e3
Compare
Instead, there is a `std::function`, which can be set just in time, that is called.
You call `childStarted`, instead of `worker.childStarted`, which takes a lambda that handles the child output. The handler can return true to end it early. This commit breaks timeouts, but the next one fixes it.
This removes the last additional entry point into Goal's subclasses, such that the CFG in the subclasses is now trivial to see.
53a81e3
to
e40d63c
Compare
Motivation
The CFG was made clearer after the switch to coroutines,
but there was still a relic of the old system via
handleChildOutput
,handleEOF
,timedOut
, andcleanup
.This PR removes all 4 of these overridable methods from
Goal
, and leaves onlyhandleChildOutput
andtimedOut
as the interface with
Worker
.Context
Related to #12628.
Probably conflicts a bit with #12663.
Replaces draft PR #12632.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.