wasm-learning icon indicating copy to clipboard operation
wasm-learning copied to clipboard

Fails to compile with go run but succeeds with go build

Open chris-aeviator opened this issue 3 years ago • 3 comments

concerning /reactr/hello

 go run -tags wasmedge main.go
# github.com/suborbital/reactr/rwasm/runtime/wasmedge
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:43:17: undefined: wasmedge.NewWasiImportObject
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:50:20: store.FindFunction undefined (type *wasmedge.Store has no field or method FindFunction)
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:52:39: cannot use "_start" (type string) as type *wasmedge.Function in argument to executor.Invoke
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:56:15: store.FindFunction undefined (type *wasmedge.Store has no field or method FindFunction)
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:58:39: cannot use "init" (type string) as type *wasmedge.Function in argument to executor.Invoke
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:72:40: undefined: wasmedge.ImportObject
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/builder.go:100:13: undefined: wasmedge.NewImportObject
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/host_function.go:27:26: undefined: wasmedge.ImportObject
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/wasmedge.go:13:11: undefined: wasmedge.ImportObject
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/wasmedge.go:19:44: cannot use fn (type string) as type *wasmedge.Function in argument to w.executor.Invoke
/home/korny/go/pkg/mod/github.com/suborbital/[email protected]/rwasm/runtime/wasmedge/wasmedge.go:19:44: too many errors

a simple go build on the other hand compiles a binary that runs my rust-wasm code successfully.

go version go1.17.1 linux/amd64
wasmedge version 0.10.0
arch linux

chris-aeviator avatar May 30 '22 08:05 chris-aeviator

Reactr depends on [email protected] and there are some breaking changes between v0.9 and v0.10. So you need to install [email protected] in your system.

DarumaDocker avatar Jun 01 '22 02:06 DarumaDocker

@DarumaDocker thanks for your reply. This is not documented in the reactr repo nor in wasmedge-go readme (mentions to specificly install 0.10 https://github.com/second-state/WasmEdge-go/blob/master/README.md?plain=1#L22).

Should I make another issue in the reactr repo for this?

chris-aeviator avatar Jun 01 '22 05:06 chris-aeviator

Of course! Then we will put it into our schedule. Thanks

DarumaDocker avatar Jun 01 '22 05:06 DarumaDocker