wasmerio / wasmer-python

🐍🕸 WebAssembly runtime for Python

Home Page:https://wasmer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to load the module?

orangeC23 opened this issue · comments

commented

Describe the bug

Use python file to execute the tmp.wasm file.
The python file : tmp-py.txt
The wasm file :
tmp-wasm.txt
Please change the suffix of these two files to .py and .wasm, respectively, because GitHub cannot directly upload files with the suffix .py or .wasm.

Steps to reproduce

python tmp.py

Expected behavior

Successfully load and execute the Wasm module as in wasmer:
/----------------------------------------------------------------------------
| |
| yosys -- Yosys Open SYnthesis Suite |
| |
| Copyright (C) 2012 - 2020 Claire Wolf claire@symbioticeda.com |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted, provided that the above |
| copyright notice and this permission notice appear in all copies. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
----------------------------------------------------------------------------/

Yosys 0.9+2406 (git sha1 8c4cb188, ccache clang 9.0.0-2~ubuntu18.04.2 -Os -flto -flto)

yosys>

Actual behavior

Traceback (most recent call last):
File "wasmer-python-A5-1.py", line 18, in
instance = Instance(module)
RuntimeError: Error while importing "wasi_snapshot_preview1"."proc_exit": unknown import. Expected Function(FunctionType { params: [I32], results: [] })

Environment: macOS and ubuntu 20.04