-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for both wasi_unstable and wasi_snapshot_preview1 import namespaces #90
Comments
Hello, Indeed, the C API used by the Go integration calls We should maybe update the C API to detect the WASI version based on the Wasm module (cf. |
@robinvanemden Here we are with #92. It'll take a few days for everything to be merged and released. Thank you in advance for your patience! |
I think #92 might help, but not entirely. Let's address issues one after the other. |
92: feat(wasi) Support `WasiGetVersion` & other `*ForVersion` WASI API r=Hywan a=Hywan Fix #90. Fix #77.⚠️ Depends on wasmerio/wasmer#1028, wasmerio/wasmer#1029, and wasmerio/wasmer#1030. They must be merged before merging this PR! Marking this PR as a draft to be sure (the shared libraries must be updated too). This patch updates `bridge.go` and `wasmer.h` to support the new `wasmer_wasi_generate_import_object_for_version` and `wasmer_wasi_get_version` functions. After that, this patch updates `wasi.go` to implement the new `NewDefaultWasiImportObjectForVersion`, `NewWasiImportObjectForVersion` and the `WasiGetVersion` functions. In addition to that, we create a new `WasiVersion` type. Finally, this patch updates the tests to test this new API. And it works like a charm 👌. Co-authored-by: Ivan Enderlin <[email protected]>
92: feat(wasi) Support `WasiGetVersion` & other `*ForVersion` WASI API r=Hywan a=Hywan Fix #90. Fix #77.⚠️ Depends on wasmerio/wasmer#1028, wasmerio/wasmer#1029, and wasmerio/wasmer#1030. They must be merged before merging this PR! Marking this PR as a draft to be sure (the shared libraries must be updated too). This patch updates `bridge.go` and `wasmer.h` to support the new `wasmer_wasi_generate_import_object_for_version` and `wasmer_wasi_get_version` functions. After that, this patch updates `wasi.go` to implement the new `NewDefaultWasiImportObjectForVersion`, `NewWasiImportObjectForVersion` and the `WasiGetVersion` functions. In addition to that, we create a new `WasiVersion` type. Finally, this patch updates the tests to test this new API. And it works like a charm 👌. Co-authored-by: Ivan Enderlin <[email protected]>
Thanks to the commits of @Hywan today (see #72, so also thanks @MarkMcCaskey and @syrusakbary, of course), it is now possible to run WebAssembly code that makes use of the WASI ABI in go-ext-wasm.
We did encounter one minor issue though. The the current releases of Clang, Wasienv, and Emscripten still produce binaries that use the
wasi_unstable
import namespace.Wasmer 0.11.0 seems to able to handle both this older, and the newer
wasi_snapshot_preview1
namespaces. But go-ext-wasm only supports the latterWe currently handle this by running "wasm2wat", find and replace
wasi_unstable
withwasi_snapshot_preview1
, and then run "wat2wasm".That works just fine, but it would be easier if go-ext-wasm could somehow handle both these, and future, namespaces.
The text was updated successfully, but these errors were encountered: