Skip to content

Simplify function call return handling - #13319

Merged
sipsma merged 2 commits into
dagger:mainfrom
sipsma:simple-func-return-thread-202606032039
Jun 4, 2026
Merged

sipsma merged 2 commits into
dagger:mainfrom
sipsma:simple-func-return-thread-202606032039

Conversation

@sipsma

@sipsma sipsma commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Record module function return values and returned errors directly on the active FunctionCall.
  • Change module runtimes to return only execution errors, then read the recorded FunctionCall result after runtime completion.
  • Remove the legacy .daggermod output/error metadata directory, mount, snapshot, and read-back path.
  • Remove module exec error extraction plumbing that existed only to support that metadata-file return path.
  • Mark returnValue and returnError as uncached imperative calls.

Why

The old return path was a holdover from the pre-Theseus cache model where function results had to be written through container filesystem metadata. In the current model, that makes function execution more convoluted and adds avoidable container output/read-back work for state that belongs to the live function call.

This keeps the public returnValue / returnError API shape intact while making the engine-side flow match the current architecture.

Validation

  • go test ./core -run 'TestFunctionCallReturn|TestTypeDefConversions'
  • go test ./core ./core/schema ./core/sdk
  • dagger --progress=plain call engine-dev test --pkg ./core/integration --run='TestModule/TestReturnNil'
  • dagger --progress=plain call engine-dev test --pkg ./core/integration --run='TestModule/TestConstructor/return error'
  • dagger --progress=plain call engine-dev test --pkg ./core/integration --run='TestModule' completed with 494 passed and only the known local TestModule/TestPrivateGitRepoArgCaching git-auth failure.

@sipsma
sipsma requested a review from vito June 3, 2026 23:17
sipsma added 2 commits June 4, 2026 11:29
Module function calls still used the legacy metadata directory to shuttle return values and returned errors out of the nested runtime container. That path existed for the older pre-Theseus cache model, but it now makes execution do extra container output work for state that is already part of the live function call.

Record return values and returned errors directly on the active FunctionCall, have runtimes return only execution errors, and read the recorded result after the runtime completes. This removes the .daggermod output/error mounts, module exec error extraction plumbing, and metadata constants while keeping the public returnValue/returnError API intact.

The simpler path also avoids the snapshot and read-back bottleneck in function call execution.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the simple-func-return-thread-202606032039 branch from b553e20 to 77d7384 Compare June 4, 2026 18:29

@vito vito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@sipsma
sipsma merged commit 20b2554 into dagger:main Jun 4, 2026
77 checks passed
tiborvass added a commit that referenced this pull request Jun 5, 2026
…ash in fd0021b

This merge commit restores the history link between 1.0-beta branch and main.
It was lost with merge commit fd0021b which
squashed the branch e45e7e4

Git tree on #13327 before squash-merging into 1.0-beta:

```
* e45e7e4 Run dagger generate
*   a01677a Merge main into 1.0-beta
|\
| * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328)
| * 20b2554 Simplify function call return handling (#13319)
| * 316ca15 Fix snapshot owner lease attach/remove race (#13321)
| * 6cfdcb4 fix(layercopy): follow source symlinks when copying directory contents (#13326)
| * 16e85ca Container exists expand option (#13310)
| * 54f9811 chore: post-release during v0.21.4 (#13316)
| * de85595 ci: bump default engine version to v0.21.3 (#13315)
| * 81bb907 chore: prep for v0.21.4 (#13314)
| * 0fd148e Show root usage when dagger has no args
| * 219b696 Volatile vars (#13223)
| * fae340c fix(layercopy): materialize resolved parent dirs when writing through… (#13308)
| * b720144 bump dang (#13306)
| * 41a7910 fix(engine): lease parent layer content for tarball export (#13307)
| * b2d43ba fix(core): attach never-cached module function results (#13298)
| * 6a7b3a7 fix incorrect artifact caching issue when releasing  (#13285)
| * 2452472 fix(core/dotenv): accept `export`-prefixed lines in .env files (#13293)
| * 24b06e7 fix: allow empty setSecret name (#13304)
| * f7ea195 fix: handle 1Password secrets with spaces (#13297)
* | 74e1a66 another pass on docs (#13325)
...
|/
* 8cc840f fix(sdk/typescript): resolve referenced values in decorator arguments (#13292)
```

Ran `git merge -s ours 1588421` on 1.0-beta to get this desired git tree:

```
*   ??gitsha?? [1.0-beta] restore merge history with main@15884210ff lost due to squash in fd0021b
|\
| * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328)
| ...
* | 94ebacb (origin/1.0-beta) update sdk docs, type-system docs, and interfaces (#13338)
* | 64eba3f (tag: v1.0.0-beta.3) [1.0-beta] feat: support synthetic workspaces (#13217)
* | fd0021b Merge main into 1.0-beta (#13327)
* | c6dd435 fix(cli): refine cloud check replay
```
tiborvass added a commit that referenced this pull request Jun 6, 2026
…ash in fd0021b

This merge commit restores the history link between 1.0-beta branch and main.
It was lost with merge commit fd0021b which
squashed the branch e45e7e4

Git tree on #13327 before squash-merging into 1.0-beta:

```
* e45e7e4 Run dagger generate
*   a01677a Merge main into 1.0-beta
|\
| * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328)
| * 20b2554 Simplify function call return handling (#13319)
| * 316ca15 Fix snapshot owner lease attach/remove race (#13321)
| * 6cfdcb4 fix(layercopy): follow source symlinks when copying directory contents (#13326)
| * 16e85ca Container exists expand option (#13310)
| * 54f9811 chore: post-release during v0.21.4 (#13316)
| * de85595 ci: bump default engine version to v0.21.3 (#13315)
| * 81bb907 chore: prep for v0.21.4 (#13314)
| * 0fd148e Show root usage when dagger has no args
| * 219b696 Volatile vars (#13223)
| * fae340c fix(layercopy): materialize resolved parent dirs when writing through… (#13308)
| * b720144 bump dang (#13306)
| * 41a7910 fix(engine): lease parent layer content for tarball export (#13307)
| * b2d43ba fix(core): attach never-cached module function results (#13298)
| * 6a7b3a7 fix incorrect artifact caching issue when releasing  (#13285)
| * 2452472 fix(core/dotenv): accept `export`-prefixed lines in .env files (#13293)
| * 24b06e7 fix: allow empty setSecret name (#13304)
| * f7ea195 fix: handle 1Password secrets with spaces (#13297)
* | 74e1a66 another pass on docs (#13325)
...
|/
* 8cc840f fix(sdk/typescript): resolve referenced values in decorator arguments (#13292)
```

Ran `git merge -s ours 1588421` on 1.0-beta to get this desired git tree:

```
*   ??gitsha?? [1.0-beta] restore merge history with main@15884210ff lost due to squash in fd0021b
|\
| * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328)
| ...
* | 94ebacb update sdk docs, type-system docs, and interfaces (#13338)
* | 64eba3f [1.0-beta] feat: support synthetic workspaces (#13217)
* | fd0021b Merge main into 1.0-beta (#13327)
* | c6dd435 fix(cli): refine cloud check replay
* | 74e1a66 another pass on docs (#13325)
```
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.

2 participants