You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Data point: I ran the full migration on this repo end-to-end with v1.0.0-beta.7 (DAGGER_X_RELEASE=v1.0.0-beta.7, go-sdk/typescript-sdk pinned to pre-asSDK(workspace:) commits since beta.7's engine predates today's SDK main). Final state: dagger functions lists everything and dagger call check passes (Go lint, backend+frontend unit tests, Cypress e2e, build). It was not out of the box — here's everything it took, with cross-refs:
dagger setup -y — config conversion itself was accurate (deps, pins, disableDefaultFunctionCaching all carried over). Two side notes: -y also auto-installed recommended modules (eslint, go) unpinned, and no .dagger/migration-report.md was produced despite errors during the migration diff.
Unpinned SDK modules broke within hours — setup wrote source = "github.com/dagger/go-sdk" unpinned; both SDK repos landed the asSDK(workspace:) change the same day, which needs a newer engine → Dang inference errors on every command. Had to pin both by commit in dagger.toml. (dagger.lock pinned github.com/dagger/go but not the SDK modules.)
Legacy .gitignore rules hid the generated files — exactly Legacy .gitignore rules break trusted runtimes after module migration #13717. Files existed on disk after generate but the git-aware source loader filtered them; error says "run dagger generate" which can't help. Fixed by removing the v0-era ignore rules by hand.
Generate bootstrap deadlock — v1 entrypoint modules break dagger generate #13742: dagger generate (even generate -l) loads all workspace modules first; modules can't load without bindings; bindings come from generate. Workaround each time: comment the module out of [modules.*] (keeping it in as-sdk.modules), generate, re-enable — once per dependency level (leaves → entrypoint).
Destructive scaffold overwrite — the beta.7 setup layout (.dagger/modules/greetings/dagger-module.toml with source = "../..") makes the go-sdk generator treat the module as new and overwrite the real main.go with the init template, silently, exit 0. Details in the next comment — this is the one failure mode here that loses user code rather than just erroring.
After restructuring to the in-place layout (.dagger/dagger-module.toml, which is what #13620 now produces), regeneration was fully clean: original go.mod module path preserved, bindings generated under the existing import path, zero modifications needed to any user .go file.
Detail: dagger generate overwrites existing module sources with the init template when the module config is detached from its source dir
The worst failure mode I hit deserves its own writeup, since #13742/#13606 describe generate failing — this is generate succeeding while destroying source code (exit 0, no warning).
Trigger. beta.7's setup migrated the root dagger.json ("source": ".dagger") into a detached config: .dagger/modules/greetings/dagger-module.toml with source = "../..". Config dir and Go sources live in different places (unlike backend/frontend/workspace, which were migrated in place).
Observed. When the go-sdk generator runs against that detached config (workspace-module-generate --root . --cwd . --local .dagger/modules/greetings), it applies module init semantics to the resolved source dir.dagger/:
main.go (155 lines: constructor with +defaultPath/+ignore annotations, Check/Test/Lint/Build/Serve/Release) replaced with the ContainerEcho/GrepDir starter template
dagger.gen.go + internal/ generated for the scaffold, not the real code
sibling files (debugger.go, develop.go, review.go, …) left in place → subsequent compile errors (g.Backend undefined, old self-import path gone)
Repro matrix (same repo, same dagger generate -y):
Config location
bindings present before?
Result
.dagger/modules/greetings/ (detached)
no
scaffold clobber
.dagger/modules/greetings/ (detached)
yes (stale)
scaffold clobber again
.dagger/dagger-module.toml (in source dir)
no
correct codegen, sources intact
in-source configs (backend/workspace/frontend)
no
correct codegen, sources intact
So the discriminator is config/source separation, not presence/staleness of bindings (backend had no bindings either and was never scaffolded), and it's deterministic — hit it twice in a row. In the in-source layout the generator preserved the module path and generated bindings under the existing import path — user sources needed zero edits.
Likely mechanism: the generator looks for module sources adjacent to the --local config path rather than at the config's resolved source dir; finding only dagger-module.toml, it takes the uninitialized-module branch and exports the init template into the resolved source root.
Repro caveat: due to the generate deadlock (#13742), generate only completes on this repo with [modules.greetings] temporarily commented out of dagger.toml (still listed in as-sdk.modules). Both clobbers happened in that state; the registered state never reaches export.
Why it still matters after #13620: in-place migration means fresh setups won't produce the detached layout, but #13620 explicitly leaves modules already under .dagger/modules/ as-is — so workspaces migrated by beta.7-era setup carry this forward, and the generator path itself remains reachable for any detached-config module.
Suggested fixes: resolve sources via the config's source field before deciding init-vs-codegen; and/or never write the init template over a non-empty source directory without an explicit opt-in.
Activity
kpenfound commentedon Jul 27, 2026
Data point: I ran the full migration on this repo end-to-end with v1.0.0-beta.7 (
DAGGER_X_RELEASE=v1.0.0-beta.7, go-sdk/typescript-sdk pinned to pre-asSDK(workspace:)commits since beta.7's engine predates today's SDK main). Final state:dagger functionslists everything anddagger call checkpasses (Go lint, backend+frontend unit tests, Cypress e2e, build). It was not out of the box — here's everything it took, with cross-refs:dagger setup -y— config conversion itself was accurate (deps, pins,disableDefaultFunctionCachingall carried over). Two side notes:-yalso auto-installed recommended modules (eslint,go) unpinned, and no.dagger/migration-report.mdwas produced despite errors during the migration diff.setupwrotesource = "github.com/dagger/go-sdk"unpinned; both SDK repos landed theasSDK(workspace:)change the same day, which needs a newer engine → Dang inference errors on every command. Had to pin both by commit indagger.toml. (dagger.lockpinnedgithub.com/dagger/gobut not the SDK modules.).gitignorerules hid the generated files — exactly Legacy .gitignore rules break trusted runtimes after module migration #13717. Files existed on disk after generate but the git-aware source loader filtered them; error says "rundagger generate" which can't help. Fixed by removing the v0-era ignore rules by hand.dagger generate(evengenerate -l) loads all workspace modules first; modules can't load without bindings; bindings come from generate. Workaround each time: comment the module out of[modules.*](keeping it inas-sdk.modules), generate, re-enable — once per dependency level (leaves → entrypoint).setuplayout (.dagger/modules/greetings/dagger-module.tomlwithsource = "../..") makes the go-sdk generator treat the module as new and overwrite the realmain.gowith the init template, silently, exit 0. Details in the next comment — this is the one failure mode here that loses user code rather than just erroring.After restructuring to the in-place layout (
.dagger/dagger-module.toml, which is what #13620 now produces), regeneration was fully clean: originalgo.modmodule path preserved, bindings generated under the existing import path, zero modifications needed to any user.gofile.kpenfound commentedon Jul 27, 2026
Detail:
dagger generateoverwrites existing module sources with the init template when the module config is detached from its source dirThe worst failure mode I hit deserves its own writeup, since #13742/#13606 describe generate failing — this is generate succeeding while destroying source code (exit 0, no warning).
Trigger. beta.7's
setupmigrated the rootdagger.json("source": ".dagger") into a detached config:.dagger/modules/greetings/dagger-module.tomlwithsource = "../..". Config dir and Go sources live in different places (unlike backend/frontend/workspace, which were migrated in place).Observed. When the go-sdk generator runs against that detached config (
workspace-module-generate --root . --cwd . --local .dagger/modules/greetings), it appliesmodule initsemantics to the resolved source dir.dagger/:main.go(155 lines: constructor with+defaultPath/+ignoreannotations, Check/Test/Lint/Build/Serve/Release) replaced with the ContainerEcho/GrepDir starter templatego.modrewritten:module github.com/kpenfound/greetings-api/.dagger→ template-stylemodule dagger/greetingsdagger.gen.go+internal/generated for the scaffold, not the real codedebugger.go,develop.go,review.go, …) left in place → subsequent compile errors (g.Backend undefined, old self-import path gone)Repro matrix (same repo, same
dagger generate -y):.dagger/modules/greetings/(detached).dagger/modules/greetings/(detached).dagger/dagger-module.toml(in source dir)So the discriminator is config/source separation, not presence/staleness of bindings (backend had no bindings either and was never scaffolded), and it's deterministic — hit it twice in a row. In the in-source layout the generator preserved the module path and generated bindings under the existing import path — user sources needed zero edits.
Likely mechanism: the generator looks for module sources adjacent to the
--localconfig path rather than at the config's resolvedsourcedir; finding onlydagger-module.toml, it takes the uninitialized-module branch and exports the init template into the resolved source root.Repro caveat: due to the generate deadlock (#13742), generate only completes on this repo with
[modules.greetings]temporarily commented out ofdagger.toml(still listed inas-sdk.modules). Both clobbers happened in that state; the registered state never reaches export.Why it still matters after #13620: in-place migration means fresh setups won't produce the detached layout, but #13620 explicitly leaves modules already under
.dagger/modules/as-is — so workspaces migrated by beta.7-erasetupcarry this forward, and the generator path itself remains reachable for any detached-config module.Suggested fixes: resolve sources via the config's
sourcefield before deciding init-vs-codegen; and/or never write the init template over a non-empty source directory without an explicit opt-in.kpenfound commentedon Jul 28, 2026
The following PRs address all of the issues encountered:
kpenfound commentedon Aug 4, 2026
setup + generate is now seamless on beta.9 🚀