okalousek opened Issue #1763:
I have tried some assemblyscript projects with WASI, but no one worked with wasmtime. All od these are working fine on wasmer.
It showes me error with something Is not a function
alexcrichton commented on Issue #1763:
Thanks for the report! Would you be able to provide us with some reproduction steps? For example what wasm modules were you working with? How did you execute them? (etc)
okalousek commented on Issue #1763:
Just downloaded these from issue links. Wasm-matrix have prebuild WASMs and hash-wasm i had to compile myself. I did not do anything special with compilation. Only runned build.
okalousek edited a comment on Issue #1763:
Just downloaded these from issue links. Wasm-matrix have prebuild WASMs and hash-wasm i had to compile myself. I did not do anything special with compilation. Only runned build.
I have executed by: wasmtime buildedname.wasm
sunfishcode commented on Issue #1763:
The "matrix" example is known to use ANSI-style escape codes to draw character graphics, and Wasmtime doesn't currently support this, because unrestricted use of ANSI-style escape codes creates a variety of security concerns (eg. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000523). We are currently working on a design which allows us to support escape sequences while ensuring security.
Could you post the error message you see when you run hash-wasm?
okalousek commented on Issue #1763:
$ wasmtime hash.wasm
Error: failed to run main module `hash.wasm` Caused by: 0: failed to instantiate "hash.wasm" 1: command export '__rtti_base' is not a function
bjorn3 commented on Issue #1763:
__rtti_base
is part of theAssemblyScript
runtime. Wasmtime doesn't allow any exported globals other than a few specific ones:
bjorn3 edited a comment on Issue #1763:
__rtti_base
is part of theAssemblyScript
runtime. Wasmtime doesn't allow any exported globals other than a few specific ones:
torch2424 commented on Issue #1763:
Hello! @pchickey brought this to my attention :smile:
@bjorn3 is correct in that looks like an export from AS runtime :smile: Though, If I understand correctly, a WASI module can have multiple exports correct? Is that a Wasmtime issue than?
@okalousek in the meantime, you could compile your AssemblyScript with
--runtime half
, as that won't export anything that is from the runtime.And wasm-matrix is a really old AS WASI example of mine (it doesn't use the runtime, it uses the old allocators directly). I've been working on some WASI examples for WasmByExample. As the AS WASI story is a lot better now, especially in very recently released
0.10.0
:smile:
torch2424 commented on Issue #1763:
And I went ahead and made a quick hello world example: https://github.com/torch2424/as-playground/tree/master/wasi-hello-world . Take a look at the
package.json
, it shows how I am using--runtime half
with the compiler, to work around this for now. Also, I provided a binary as well @okalousek if you want to test it quickly :smile:
sunfishcode commented on Issue #1763:
AssemblyScript programs are now fixed, as of #1773. Use of
--runtime half
is recommended for command-style programs like this, though not strictly required (for now). Thanks for your help everyone!I've also now collected the information here into a document showing how to run AssemblyScript programs in Wasmtime:
https://bytecodealliance.github.io/wasmtime/wasm-assemblyscript.html
sunfishcode closed Issue #1763:
I have tried some assemblyscript projects with WASI, but no one worked with wasmtime. All od these are working fine on wasmer.
It showes me error with something Is not a function
torch2424 commented on Issue #1763:
Yay! Thank you @sunfishcode ! :smile:
Last updated: Dec 23 2024 at 12:05 UTC