feat(go-sdk): no longer generate the core bindings#12926
Draft
TomChv wants to merge 3 commits intodagger:mainfrom
Draft
feat(go-sdk): no longer generate the core bindings#12926TomChv wants to merge 3 commits intodagger:mainfrom
TomChv wants to merge 3 commits intodagger:mainfrom
Conversation
Member
Author
|
Related to #11547 |
Signed-off-by: Tom Chauveau <tom@dagger.io>
Signed-off-by: Tom Chauveau <tom@dagger.io>
Signed-off-by: Tom Chauveau <tom@dagger.io>
18693a4 to
8f3f1a7
Compare
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.
Summary
dagger.io/daggerin Go module and standalone client codegenQuery,Binding,Env) embed their SDK counterparts and only override methods that return other extendable typesdagger.io/daggerlib version for client generation in dev mode so schema stays in syncWhat changed
Core type aliases: For both modules (
internal/dagger/dagger.gen.go) and standalone clients (dagger.gen.go), core API types likeContainer,Directory,File, etc. are now generated as Go type aliases (type Container = dagger.Container) instead of full struct + method definitions. This preserves type identity —mymodule/internal/dagger.ContainerISdagger.io/dagger.Container, enabling third-party library interoperability.Extendable type wrappers:
Query,Binding, andEnvcan't be simple aliases because dependency modules add methods to them. Instead, they embed the SDK type (dagger.Query) and only generate:WithGraphQLQuery()/With()overrides (to return the wrapper type)Query.Container(),Query.Directory()) are inherited from the embedded SDK typeWithGraphQLQueryinstead of struct literals: In non-library mode, object construction usesnew(T).WithGraphQLQuery(q)instead of&T{query: q}, since aliased types have unexported fields.Client lib version pinning: Standalone client generation now receives the engine's
--lib-versionflag so that dev engines can resolvedagger.io/daggerat the correct commit.Signed-off-by: Tom Chauveau tom@dagger.io