Remove multiple entrypoints into Goal code#12668
Closed
L-as wants to merge 4 commits intoNixOS:masterfrom
Closed
Conversation
Member
Author
|
Worked around |
Member
Author
|
My bug! Clang just didn't trigger it. |
aac0ed7 to
78d0faa
Compare
59e89ba to
4041b24
Compare
edolstra
reviewed
Mar 24, 2025
edolstra
reviewed
Mar 24, 2025
| unsigned long & logSize, | ||
| std::string & currentLogLine, | ||
| size_t & currentLogLinePos, | ||
| std::list<std::string> & logTail |
Member
There was a problem hiding this comment.
This is a lot of function arguments. Maybe this could be moved into a struct? (Possibly in a future PR.)
Member
There was a problem hiding this comment.
@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.
53a81e3 to
e40d63c
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.
e40d63c to
2c1defe
Compare
Member
|
I believe this has now been done (!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onlyhandleChildOutputandtimedOutas 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.