Repository navigation
Conversation
af4e1ca to
ca5793c
Compare
ca5793c to
9ce2a11
Compare
9ce2a11 to
b45db48
Compare
f81f5d0 reduced the runtime-codegen gate to config format alone: dagger-module.toml modules always build their committed generated files as-is. But bindings generated before v1.0.0-beta.6 cannot serve type discovery: the generated invoke() dispatcher's empty-parentName typedef-registration arm — which module loading (getModDef) relies on — was removed from codegen in dagger#10584 and only reintroduced in dagger#13381, first released in v1.0.0-beta.6. Loading such a module fails with "unknown object", and there is no way out from the CLI, since regenerating the bindings requires loading the module first. Gate the committed-files path on a fixed capability floor: modules pinned below v1.0.0-beta.6 fall back to runtime codegen so their bindings are regenerated to match; anything pinned at or above the floor keeps the committed-files behavior regardless of how much newer the running engine is. The floor is compared with full prerelease precision — it landed in a beta, so base-version comparison would wrongly trust bindings from earlier betas. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
b45db48 to
2b2df7b
Compare
|
Repro — branch: kpenfound/greetings-api@repro The branch captures a repo that migrated to the workspace format on v1.0.0-beta.6 with committed pre-1.0 bindings, in two commits:
From there: DAGGER_X_RELEASE=v1.0.0-beta.6 dagger api functions # works beta.7 fails with: failed to call module "greetings" to get functions: unknown object What's happening: beta.6 still regenerates bindings at runtime, so the stale committed files don't matter and the migration appears successful. beta.7 has the config-format gate — dagger-module.toml modules build their The practical impact is an upgrade cliff: migrating on beta.6 with committed bindings feels fine, and the repo breaks the first time anyone opens it with beta.7+. |
|
The real blocking path for this is resolved in beta.9. The remaining question is if we should automatically generate after migration, which would eliminate any confusing errors. That will be tracked separately |
Problem
Since f81f5d0, the runtime-codegen gate is decided by config format alone:
dagger-module.tomlmodules never regenerate bindings at runtime — the runtime builds the committed generated files as-is.But committed bindings can only serve module loading if they can describe the module's types. Type discovery (the engine's getModDef call) relies on the empty-parentName typedef-registration arm in the generated
invoke()dispatcher — an arm that was removed from codegen in #10584 (when typedefs moved to SDK-side discovery) and only reintroduced in #13381, first released in v1.0.0-beta.6. Adagger-module.tomlmodule whose committeddagger.gen.gowas generated by anything older compiles fine, but its dispatcher falls into the default branch and every load fails with:(with an empty object name, since the parent name of a getModDef call is empty). If the module's source has drifted from the stale bindings, the failure is a
go builderror inside the runtime instead.Worse, there is no way out from the CLI: the fix for stale committed bindings is
dagger generate, but generate needs to load the module, which needs the typedefs, which the stale bindings can't provide.Fix
Keep the config-format rule (
dagger.jsonalways regenerates;dagger-module.tomlbuilds committed files), but gate the committed-files path on a fixed capability floor,MinimumSelfServingBindingsModuleVersion = "v1.0.0-beta.6":The floor is compared with full prerelease precision (
semver.Compare, notCheckVersionCompatibility): the arm landed in a beta, and base-version comparison would wrongly trust bindings from earlier betas.This gates both the builtin Go SDK path and module-implemented SDKs (
skipRuntimeCodegen).Tests
TestOldEngineVersionKeepsRuntimeCodegen: a module pinned to v0.20.3 with nothing committed loads via runtime regeneration.TestPostFloorEngineVersionTrustsCommittedFiles: a module pinned exactly at the floor (older than the running engine) still takes the committed-files path — nothing is committed, so it fails with thedagger generatehint instead of silently regenerating.TestMissingGeneratedFiles,TestLegacyConfigKeepsRuntimeCodegen) unaffected.🤖 Generated with Claude Code