You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I need to compile for wasm32-unknown-unknown architecture. I'm trying to use wasm target with a WIT file like this:
package tinygo:test;
interface test {
record log {
message: string,
}
}
world tinygo-test {
export test;
}
And an empty main file
package main
func main() {
}
But it leads to an error referring to wasi preview 1.
$ tinygo build -target=wasm -o tgotest.wasm --wit-packag
e ./world.wit --wit-world tinygo-test main.go
error: failed to encode a component from module
Caused by:
0: failed to decode world from module
1: module was not valid
2: failed to resolve import `wasi_snapshot_preview1::proc_exit`
3: module requires an import interface named `wasi_snapshot_preview1`
`wasm-tools component new` failed: exit status 1
Currently I workaround this, providing a special json file like this as the target:
Hello, I need to compile for wasm32-unknown-unknown architecture. I'm trying to use wasm target with a WIT file like this:
And an empty main file
But it leads to an error referring to wasi preview 1.
Currently I workaround this, providing a special json file like this as the target:
But it requires C files to implement functions that are still searched by tinygo (namely:
abort
,free
, andmalloc
).How can I avoid the use of this workaround and compile wasm without any reference to wasi (p1 or p2) or javascript requirements?
Thanks.
The text was updated successfully, but these errors were encountered: