fix: scope module generation to the module path#5
Open
TomChv wants to merge 1 commit into
Open
Conversation
TomChv
added a commit
to dagger/typescript-sdk
that referenced
this pull request
Jul 23, 2026
Temporary: point the polyfill dependency at fix/module-generate-scope-to-path (dagger/polyfill#5) so multi-module / workspace-root generate works. Revert to @main once that PR merges. Signed-off-by: Vasek - Tom C <tom@dagger.io>
TomChv
added a commit
to dagger/go-sdk
that referenced
this pull request
Jul 23, 2026
Temporary: point the polyfill dependency at fix/module-generate-scope-to-path (dagger/polyfill#5) so multi-module / workspace-root generate works. Revert to @main once that PR merges. Signed-off-by: Vasek - Tom C <tom@dagger.io>
PolyfillModuleSource.generate rooted the generated context and fork at the
caller cwd. At the workspace root (cwd '.') that captured the whole
workspace — including any staged dependency codegen — in the changeset's
before/after snapshots. When several modules are generated and their
changesets merged (e.g. a root 'dagger generate'), the staged dependencies
leak across modules: they cancel out (a dependency's codegen goes missing)
or conflict on apply ('already exists').
Root the generated context at the module's own path and stage it on an
empty fork base, so each module's changeset contains only its own files.
Unchanged for a subdir cwd, where path already equals the cwd.
Signed-off-by: Vasek - Tom C <tom@dagger.io>
TomChv
force-pushed
the
fix/module-generate-scope-to-path
branch
from
July 23, 2026 14:21
c2a9322 to
4357bc1
Compare
kpenfound
approved these changes
Jul 23, 2026
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.
PolyfillModuleSource.generaterooted the generated context and the fork at the caller cwd. In a module subdirectory that's fine (the cwd is the module). But at the workspace root (cwd = ".") it captured the whole workspace — including any staged dependency codegen — in the changeset'sbefore/aftersnapshots.When several modules are generated and their changesets merged (e.g. a root
dagger generaterunning the Go and TypeScript SDK generators), the staged dependency codegen leaks across modules:beforesnapshot and cancels out (goes missing from the output), orbefores and then conflicts on apply (.dagger/modules/b/... already exists).Fix
Root the generated context at the module's own path and stage it on an empty fork base, so each module's changeset contains only its own files. Behavior is unchanged for a subdir cwd (there
path == cwd).This unblocks
ModuleSource.generateLocalDependencies(dagger/dagger#13706) for the multi-module / workspace-root case.PR chain
ModuleSource.generateLocalDependencies(+ the runtime fixes found in validation)@generateuses the API@generateuses the APIThe two SDK PRs depend on both the engine PR and the polyfill PR. The engine and polyfill PRs are independent of each other.