Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/wago-org/component-model

go 1.22.0

require github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0
require github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0 h1:JACyOKg+wp+pnQpu3ApLHDjrKxpN3/5zOFgnk/Xkayo=
github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0/go.mod h1:odr+6v51s1UDezUBJZrBBujWs/iD1pSHHhAVkb8BTQ0=
github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9 h1:+/8b9bvAnyUZPG+YTvGpDwpAV+jpp6+bBBWOrr+8Xco=
github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9/go.mod h1:q0pPiPF6W6GZpTXbWwy+GT+r19KHSzB/gRcPUVHyntI=
12 changes: 7 additions & 5 deletions internal/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ func (r *runtimeAdapter) instantiateModule(ctx context.Context, c CompiledModule
continue
}
resolvedFuncs[coreImportIdentity{module: spec.Module, name: spec.Name}] = fn
var host core.HostFunc
var host any
if hf, ok := fn.(*hostFunction); ok {
host = core.HostFunc(func(caller core.HostModule, params, results []uint64) {
host = func(caller core.Caller, call core.HostCall) {
params, results := call.ParamSlots(), call.ResultSlots()
defer func() {
if recovered := recover(); recovered != nil {
switch recovered.(type) {
Expand All @@ -266,15 +267,16 @@ func (r *runtimeAdapter) instantiateModule(ctx context.Context, c CompiledModule
callCtx := context.WithValue(ctx, activeCallerKey{}, caller)
hf.fn.Call(callCtx, callerModule{caller: caller}, stack)
copy(results, stack)
})
}
} else if wf, ok := fn.(*wasmFunction); ok {
host = core.HostFunc(func(caller core.HostModule, params, results []uint64) {
host = func(caller core.Caller, call core.HostCall) {
params, results := call.ParamSlots(), call.ResultSlots()
out, callErr := wf.mod.in.InvokeFromHost(ctx, caller, wf.name, params...)
if callErr != nil {
panic(core.HostTrap{Err: callErr})
}
copy(results, out)
})
}
}
if host != nil {
owner, err := r.funcrefs.New(host, core.FuncSig{
Expand Down
11 changes: 0 additions & 11 deletions testdata/conformance/wasmtime/xfail.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
"async__cancel-starting-subtask-does-not-leak__0000__L9": "component execution semantics for this regression are incomplete",
"async__drop-host__0000__L5": "component execution semantics for this regression are incomplete",
"async__drop-waitable-set-stackful__0000__L13": "fixture exceeds the plugin memory authority budget",
"async__exceptions__0001__L67": "core exception handling is disabled in Wago",
"async__exceptions__0003__L69": "core exception handling is disabled in Wago",
"async__exceptions__0006__L143": "core exception handling is disabled in Wago",
"async__exceptions__0008__L145": "core exception handling is disabled in Wago",
"async__exceptions__0011__L215": "core exception handling is disabled in Wago",
"async__exceptions__0013__L217": "core exception handling is disabled in Wago",
"async__fused__0004__L104/action/L148": "required component-model trap is not enforced",
"async__future-cancel-write-completed__0000__L5": "complete imported and aliased component type retention is not implemented",
"async__future-drop-writable-after-notified-drop__0000__L4/action/L160": "this component re-entry shape is not implemented by Wago",
Expand Down Expand Up @@ -91,10 +85,6 @@
"async__wait-forever2__0000__L5": "fixture exceeds the plugin memory authority budget",
"async__yield-when-cancelled__0000__L6/action/L97": "this component re-entry shape is not implemented by Wago",
"error-context-trap-in-post-return__0001__L45/action/L46": "required component-model trap is not enforced",
"exceptions__0000__L22": "core exception handling is disabled in Wago",
"exceptions__0002__L54": "core exception handling is disabled in Wago",
"exceptions__0004__L90": "core exception handling is disabled in Wago",
"exceptions__0006__L132": "core exception handling is disabled in Wago",
"exceptions__0008__L168": "core exception handling is disabled in Wago",
"fixed_length_lists__0000__L18": "114: decode component: nested component[0]: type section: type[0]: instancedecl[0]: unsupported (M1): defvaltype tag 0x67",
"gc__empty__0000__L8": "component core-type sections are not implemented",
Expand All @@ -103,7 +93,6 @@
"implements__0000__L3": "extern-name attributes are not implemented",
"import__0000__L1": "complete component semantic validation is not implemented",
"import__0001__L7": "114: instantiation succeeded, want trap containing \"expected instance found func\"",
"instance__0003__L34": "this component re-entry shape is not implemented by Wago",
"instance__0006__L104": "component execution semantics for this regression are incomplete",
"instance__0007__L130": "component execution semantics for this regression are incomplete",
"instance__0008__L161": "component execution semantics for this regression are incomplete",
Expand Down
12 changes: 11 additions & 1 deletion testdata/conformance/wasmtime/xfail_windows.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"async__intra-streams__0004__L118": "Wago's Windows backend does not yet implement core multi-memory",
"async__exceptions__0001__L67": "Wago's Windows backend does not yet implement core exception handling",
"async__exceptions__0003__L69": "Wago's Windows backend does not yet implement core exception handling",
"async__exceptions__0006__L143": "Wago's Windows backend does not yet implement core exception handling",
"async__exceptions__0008__L145": "Wago's Windows backend does not yet implement core exception handling",
"async__exceptions__0011__L215": "Wago's Windows backend does not yet implement core exception handling",
"async__exceptions__0013__L217": "Wago's Windows backend does not yet implement core exception handling",
"exceptions__0000__L22": "Wago's Windows backend does not yet implement core exception handling",
"exceptions__0002__L54": "Wago's Windows backend does not yet implement core exception handling",
"exceptions__0004__L90": "Wago's Windows backend does not yet implement core exception handling",
"exceptions__0006__L132": "Wago's Windows backend does not yet implement core exception handling",
"async__intra-streams__0004__L118": "Wago's Windows backend does not yet implement core multi-memory",
"async__intra-streams__0006__L179": "Wago's Windows backend does not yet implement core multi-memory"
}
1 change: 0 additions & 1 deletion testdata/conformance/xfail.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"binary__binary__0117__L1465": "complete component semantic validation is not implemented",
"linking__link-time-virtualization__0000__L2": "component core-type sections are not implemented",
"linking__shared-everything-dynamic-linking__0000__L4": "component core-type sections are not implemented",
"linking__shared-everything-dynamic-linking__0010__L152": "component re-entry leaves a host funcref importer live during teardown",
"linking__shared-everything-dynamic-linking__0010__L152/action/L191": "this component re-entry shape is not implemented by Wago",
"linking__tags__0000__L7": "core exception handling is disabled in Wago",
"linking__tags__0003__L36": "core exception handling is disabled in Wago",
Expand Down
Loading