Repository navigation
go: give the engine a function's error file - #113
Merged
Merged
Conversation
An engine that names a file for the function's error (DAGGER_FUNCTION_ERROR_PATH, dagger/dagger#15249) now gets it there from every dispatcher, whatever the module targets: {"message", "values"}, the message in full with the origin it names, and the extensions of the GraphQL error it wraps as they are, so a caller gets a typed ExecError with its exit code and output. The dispatcher then prints nothing of its own; the report is shortened only past the engine's 1 MiB limit. Without the variable, or a file it can write, it falls back to the stderr markers older engines read. The generated entrypoint raises a module process's exec error as it is, so the engine's handling of it is never preempted by the marker parsing or the Dagger Error rebuilt from the values marker. Signed-off-by: Alex Suraci <[email protected]>
An engine that names a function error file marks the dispatcher's exec error as the module process's even when the dispatcher couldn't write the file and printed the marker lines instead; raising every such error as it is made that fallback dead. The entrypoint now raises an exec error as it is only when it carries the report the engine read (functionError), and parses the markers otherwise. Also say that passesErrorValues only matters to engines without the file, and that the e2e error relay check passes through either path. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 22, 2026
Pin go-sdk to dagger/go-sdk#113 (5ed109c), whose dispatcher writes a function's error to the engine's DAGGER_FUNCTION_ERROR_PATH and whose entrypoint raises the exec error that carries it as it is, and regenerate the go fixture and the shared dep, a go-sdk module. Every sdks-go golden now renders as its target, fail-api included, except broken-default: its "┇ build ›" breadcrumb is still a placeholder, and the real one lists the entrypoint's dagger/go calls. Its compiler error moved to ./main.go:93:9 when fail-api grew the fixture. The dep's rows are now clean in every SDK's call-failing-dep goldens, as the targets have them, so the Python ones drop the rows relaxed for it: the ::dagger-function-error:: echo and the failed "call module entrypoint". The dep's failure also reaches Python as an ExecError, values and all, so its traceback ends in dagger.ExecError rather than dagger.QueryError. Go's fail-exec-wrapped, which records today's output since wrapping isn't targeted, loses the same entrypoint row, marker and traceparent, and with the echo the wrapping message: it is now nowhere, even expanded, as for dang. The fixture notes say so. Signed-off-by: Alex Suraci <[email protected]>
This was referenced Nov 22, 2026
vito
marked this pull request as ready for review
November 22, 2026 20:33
The dispatcher now reads function error values from gqlerror, so a new module's generated code imports it and engines should pre-warm it. Signed-off-by: Alex Suraci <[email protected]>
sipsma
approved these changes
Nov 24, 2026
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 24, 2026
Pin go-sdk to dagger/go-sdk#113 (5ed109c), whose dispatcher writes a function's error to the engine's DAGGER_FUNCTION_ERROR_PATH and whose entrypoint raises the exec error that carries it as it is, and regenerate the go fixture and the shared dep, a go-sdk module. Every sdks-go golden now renders as its target, fail-api included, except broken-default: its "┇ build ›" breadcrumb is still a placeholder, and the real one lists the entrypoint's dagger/go calls. Its compiler error moved to ./main.go:93:9 when fail-api grew the fixture. The dep's rows are now clean in every SDK's call-failing-dep goldens, as the targets have them, so the Python ones drop the rows relaxed for it: the ::dagger-function-error:: echo and the failed "call module entrypoint". The dep's failure also reaches Python as an ExecError, values and all, so its traceback ends in dagger.ExecError rather than dagger.QueryError. Go's fail-exec-wrapped, which records today's output since wrapping isn't targeted, loses the same entrypoint row, marker and traceparent, and with the echo the wrapping message: it is now nowhere, even expanded, as for dang. The fixture notes say so. Signed-off-by: Alex Suraci <[email protected]>
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.
Depends on dagger/dagger#15249, which adds the engine side: the module process's function error file,
DAGGER_FUNCTION_ERROR_PATH.When the engine sets that variable on the dispatcher's exec, the dispatcher writes the function's error there instead of printing it, as dagger/python-sdk#93 does for Python:
{"message": "<err.Error(), in full, [traceparent:…] kept>", "values": {<the inner GraphQL error's extensions, verbatim>}}ExecErrorwith the inner exec's exit code, output and command.dagger callexits with the inner exit code.::dagger-function-error::or::dagger-function-error-values::lines, so the function's row shows only what the function itself logged.errorValuesFloornow only gates the old-engine fallback.Falling back on older engines: without the variable, or when the file can't be written, the dispatcher prints the markers as before.
The generated entrypoint's
raiseFunctionErrorraises the exec error unchanged when it carries the report the engine read (functionError). The engine's module-process handling then applies, and neither the marker parsing nor the values-markerDagger.error()rebuild preempts it. Any other exec error still goes through the markers.Tested:
templates/v2_test.gocover the file's contents, the 1 MiB cap, printing nothing else, the fallback when the file can't be written, and the entrypoint guard.sdks-go-*golden match its target, exceptbroken-default's placeholder breadcrumb, which is an engine/TUI question. The shared go-sdk dependency's rows are clean in every SDK'scall-failing-depgoldens.TestModuleEntrypointFunctionErrorGoSDK, checks that a caller gets a typedExecErrorfrom a go-sdk function.