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
I'm trying to run and access PGLite through a golang program via wasmer-go. However it fails with the error regardgin env not instantiated. I assume that there is no support for other runtimes (#40)
Is there a way I could contribute to adding support for more runtimes?
$ wazero run postgres.wasm
error instantiating wasm binary: module[env] not instantiated
$ wasmtime postgres.wasm
Error: failed to run main module `postgres.wasm`
Caused by:
0: failed to instantiate "postgres.wasm"
1: unknown import: `env::invoke_ii` has not been defined
The text was updated successfully, but these errors were encountered:
A .wasm file will declare a bunch of functions it needs to execute properly. WASI and WASIX are standard sets of such functions. A pure WASI/WASIX web assembly program can be run in a WASI/WASIX runtime like wasmer without changes. At the moment, PGlite ships a wasm binary with a JS file that provides many custom Emscripten non-standard functions that wasmer doesn't have.
A WASIX (note the x, not WASI) build of pglite shouldn't be too tough because it has a very broad API. You link the wasix libc and that libc will compile imports in the .wasm binary that wasmer understands. You could even compile totally vanilla postgres to wasm32-wasix-none. I'd love to use a wasix pg instead of bloated, ram hungry docker pg! https://wasix.org/docs/language-guide/c/usage.
WASI should be possible through Emscripten by using the -sWASM_STANDALONE=1 linker flag. It can work, but will take some finagling to pass tests.
I'm trying to run and access PGLite through a golang program via wasmer-go. However it fails with the error regardgin
env
not instantiated. I assume that there is no support for other runtimes (#40)Is there a way I could contribute to adding support for more runtimes?
The text was updated successfully, but these errors were encountered: