Convert build parallelism to a more synchronous model - #3569
Conversation
7e7edfe to
d7b78da
Compare
fa3786b to
713ed97
Compare
|
Note to self: I think there might be something slightly off about debug tools somewhere (have observed this internally but I have little understanding yet of what the test in question is doing) |
Nope not caused by this. I assumed a failure that obvious would be, but it seems broken on master. Fixed in #3593 |
c1ae6b0 to
8dfcf5d
Compare
| if v.Err != nil { | ||
| return v.Val, v.Err | ||
| } else if first { | ||
| defer func() { |
There was a problem hiding this comment.
Please document the fact that this will recover if f panics
| } | ||
|
|
||
| // WaitForPackage drops the interpreter lock and waits for the given package to be parsed. Like | ||
| // WaitForSubrepo drops the interpreter lock and waits for the given package to be parsed. Like |
There was a problem hiding this comment.
"given package" -> "given subrepo"
"to be parsed" -> "to be defined"?
|
|
||
| type runner struct { | ||
| tasks *errgroup.Group | ||
| ctx context.Context //nolint:containedctx |
There was a problem hiding this comment.
Please justify why it's reasonable to store the context?
| if s != nil { | ||
| return nil | ||
| } | ||
| if _, err := r.parse(ctx, defining, dependent, true, wait); err != nil && !errors.Is(err, parse.ErrMissingBuildFile) { |
There was a problem hiding this comment.
If we ignore ErrMissingBuildFile, doesn't that imply that this can return nil and the subrepo still is not available?
The fork's master carried the Windows port on top of 17.33.0. That same work, rebased onto upstream's master after thought-machine#3569 ("Convert build parallelism to a more synchronous model") and with plz update now downloading the whole release zip on Windows, is on windows-rebase. This merge takes windows-rebase's tree as it is, so master now matches what is headed upstream, while keeping the old history reachable instead of rewriting it.
Brings back the fork's 18.0.0 and 18.0.1 ChangeLog entries and milestone page, which the upstream-bound branch leaves out, and adds 18.1.0: the rebase onto thought-machine#3569, plz update downloading the whole zip on Windows, and --shell's slash-separated directory. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaLmkJrkt7eRJC9uPXvbKe
This will (hopefully) make the parallelism easier to understand and avoids some of the weird edge cases we had before. The fan-out logic is now all in
src/plzand has been cut out ofsrc/core. The model there is quite a lot more synchronous - essentially it calls a function like Build or Test which builds all a target's dependencies, then that target, blocking until it's done.We can drop a few of the concepts we had before (like "parse mode", "resolving dependencies" and things like that) and we can lose the maps of "pending things" on the build state. It's simpler around things like subincludes because when we get there we just ask to build the thing, we don't have to ask it to parse then figure out at the end of that whether we should trigger things to build or not.
I ran the in-repo perf tests and they are actually faster than before. That's nice to see although it was not expected - it appears to be that we have fewer concurrently live goroutines because all the dependency resolution stuff is gone. I think it's a bit of a parse-only effect though.