Repository navigation
generate-all: parallelize, fix losing changes - #13
Merged
Merged
Conversation
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
TomChv
reviewed
Jul 24, 2026
| """ | ||
| The helper should expose the generate skip marker used by callers. | ||
| """ | ||
| pub skipGenerateFilenameCheck: Void @check { |
Member
There was a problem hiding this comment.
Why all the functions are not public anymore?
Contributor
Author
There was a problem hiding this comment.
It's not needed anymore by Dang, the formatter removes them. pub is default so it looks more like graphql
TomChv
approved these changes
Jul 24, 2026
TomChv
added a commit
that referenced
this pull request
Jul 27, 2026
When @generate runs nested under the engine's ModuleSource.generateLocalDependencies (the SDK generator invoked per local dependency), the workspace it receives already has the leaf dependency closure staged. #13 assembles the result as ws.changes.withChangesets(changes); in that nested context ws.changes re-included the staged closure, which then (a) got re-rooted under the dependent's path by the engine (b/.dagger/modules/a/...) and (b) octopus-merged against the freshly generated, overlapping files (apply ours patch: ... already exists) — for Go modules with a local-dependency closure of 3+. Fold onto pws.fork.changes (an empty changeset) instead, keeping #13's parallel map + {{isEmpty}} force. Only each module's own changes remain, so nothing re-enters the result. Matches the TypeScript SDK, which never reproduced this. Signed-off-by: Vasek - Tom C <[email protected]>
TomChv
added a commit
that referenced
this pull request
Jul 28, 2026
Before generating each managed module, stage its transitive local dependency closure via ModuleSource.generateLocalDependencies and overlay it onto the workspace, so the module's codegen sees up-to-date dependency bindings — including dependencies owned by other SDKs. The staged dependency codegen is ephemeral: each changeset is taken against the staged workspace, so it cancels out, leaving only each module's own changes. Bumps the polyfill pin to pick up dagger/polyfill#5 (scope module generate to path) from @main. When @generate runs nested under the engine's ModuleSource.generateLocalDependencies (the SDK generator invoked per local dependency), the workspace it receives already has the leaf dependency closure staged. #13 assembles the result as ws.changes.withChangesets(changes); in that nested context ws.changes re-included the staged closure, which then (a) got re-rooted under the dependent's path by the engine (b/.dagger/modules/a/...) and (b) octopus-merged against the freshly generated, overlapping files (apply ours patch: ... already exists) — for Go modules with a local-dependency closure of 3+. Fold onto pws.fork.changes (an empty changeset) instead, keeping #13's parallel map + {{isEmpty}} force. Only each module's own changes remain, so nothing re-enters the result. Matches the TypeScript SDK, which never reproduced this. Signed-off-by: Tom Chauveau <[email protected]>
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.
This changes
generateAllto generate all modules in parallel, and also fixesno changes to applywhen there clearly were changes. I'm not entirely sure why the latter is fixed by this - still investigating.For posterity, here's the original repro for "the latter":
dagger --x-release 1.0.0-beta.7 generate dagger-go-sdk:generate-allin repo root => fails due to compilation errordagger --x-release 1.0.0-beta.7 generate dagger-go-sdk:generate-all=>no changes to applytouchto makedagger.gen.goolder => no effect, stillno changes to applycd toolchains/engine-devand run same generate command => that works