Skip to content

cm: Use public type for errorContext wasm functions#339

Merged
ydnar merged 1 commit intobytecodealliance:mainfrom
lxfontes:lxfontes/public-error-context
Apr 27, 2025
Merged

cm: Use public type for errorContext wasm functions#339
ydnar merged 1 commit intobytecodealliance:mainfrom
lxfontes:lxfontes/public-error-context

Conversation

@lxfontes
Copy link
Copy Markdown
Member

wadge ( Test Harness generator ) scans all generated code and no longer works with cm package version 2.x.

code generated via wit-bindgen-go uses Public Types for wasmimport/export functions.
The newly introduced ErrorContext in cm uses a private type ( errorContext ), making it impossible to shim it with go:linkname.

# github.com/wasmCloud/go/examples/component/http-server_test [github.com/wasmCloud/go/examples/component/http-server.test]
./bindings.wadge_test.go:24:78: name errorContext not exported by package cm
./bindings.wadge_test.go:44:70: name errorContext not exported by package cm
FAIL	github.com/wasmCloud/go/examples/component/http-server [build failed]

what wadge generates after parsing wit generated code:
Screenshot 2025-04-23 at 12 05 57 PM

Signed-off-by: Lucas Fontes <lucas@cosmonic.com>
@lxfontes lxfontes requested a review from ydnar as a code owner April 24, 2025 15:25
@ydnar ydnar merged commit 3fc6d1e into bytecodealliance:main Apr 27, 2025
13 checks passed
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