Skip to content

feat(go): deliver build files through entrypoint sources - #67

Merged
eunomie merged 9 commits into
dagger:mainfrom
eunomie:entrypoint-sources-uniform
Oct 15, 2026
Merged

eunomie merged 9 commits into
dagger:mainfrom
eunomie:entrypoint-sources-uniform

Conversation

@eunomie

@eunomie eunomie commented Oct 15, 2026

Copy link
Copy Markdown
Member

Each Go entrypoint declares sources(workspace): the module directory plus outside files its build reads (go.mod local replace). types and call are uniform and take no workspace, so results are cached across sessions until a returned file changes. Replaces #64's workspace compilation.

Do not merge before dagger/dagger#14693 is in a release: every Go entrypoint module generated by this SDK needs it (v1.0.0-beta.18 if released after that merge).

// app/go.mod: replace example.com/lib => ../lib
func (*App) Greeting() string { return greet.Greeting() }
  • dagger generate writes fixed patterns from replaces, imports, embeds; regenerate after changes.
  • sources runs at each load with a working client and the trust of module code.
  • Floor: every generated module needs v1.0.0-beta.18; beta.17 fails at load: missing argument "workspace".

Tests: unit, golden, dev-engine e2e.
Not covered: engine-e2e sources-check until the release pin.
Limits: cached call 0.3-0.4 s; 0.44-0.58 s on 16.6k files (one root read per load).
Scan: no module-graph selection; rare version replaces add or miss files.

Walkthrough: https://gistpreview.github.io/?4ff3d8d0379cdcbf96e7041aed5b7610

Generation globbed and uploaded the whole workspace. Restore the 7f77348
scan of the go.mod replace targets, with the .. fix of 3666a71.

Signed-off-by: Yves Brissaud <[email protected]>
Every generated entrypoint returns the module and the files its build
reads from sources; types and call take no workspace, so the engine
reuses function results until one of those files changes.

Signed-off-by: Yves Brissaud <[email protected]>
A module directory without a manifest got the starter template written
over its main.go, so generation scanned the starter instead.

Signed-off-by: Yves Brissaud <[email protected]>
With dangEntrypoint unset, an existing module keeps its current runner and
only fresh modules get the Dang entrypoint. A module that fails to load is
skipped with no message.

Signed-off-by: Yves Brissaud <[email protected]>
currentModule.contextDirectory already holds the module source at
sourceSubpath, and the engine derives currentModule.source from it, so
placing the source back was an identity.

Signed-off-by: Yves Brissaud <[email protected]>
The sources guard generates its fixture on that engine: beta.17 refuses
the caller's client, which loads include-app.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie merged commit d45fdf4 into dagger:main Oct 15, 2026
9 checks passed
@eunomie
eunomie deleted the entrypoint-sources-uniform branch October 15, 2026 19:53
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 20, 2026
No go-sdk tag has the beta.18 sources contract (dagger/go-sdk#67), the
include migration (dagger/go-sdk#69) or dependencies through the global
client (dagger/go-sdk#70).

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 21, 2026
No go-sdk tag has the beta.18 sources contract (dagger/go-sdk#67), the
include migration (dagger/go-sdk#69) or dependencies through the global
client (dagger/go-sdk#70).

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
No go-sdk tag has the beta.18 sources contract (dagger/go-sdk#67), the
include migration (dagger/go-sdk#69) or dependencies through the global
client (dagger/go-sdk#70).

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
No go-sdk tag has the beta.18 sources contract (dagger/go-sdk#67), the
include migration (dagger/go-sdk#69) or dependencies through the global
client (dagger/go-sdk#70).

Signed-off-by: Yves Brissaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant