Skip to content
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

wasmer support #106

Closed
liudonghua123 opened this issue Jun 5, 2023 · 1 comment
Closed

wasmer support #106

liudonghua123 opened this issue Jun 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@liudonghua123
Copy link

Is your feature request related to a problem? Please describe.

I tried to execute python-3.11.3.wasm download from https://github.com/vmware-labs/webassembly-language-runtimes/releases/tag/python%2F3.11.3%2B20230428-7d1b259 within my wasmer, but it failed with the following errors.

D:\Downloads>wasmer run python-3.11.3.wasm
error: failed to run `python-3.11.3.wasm`
│   1: failed to instantiate WASI module
│   2: Instantiation failed
╰─▶ 3: Error while importing "wasi_snapshot_preview1"."sock_accept": unknown import. Expected Function(FunctionType { params: [I32, I32, I32], results: [I32] })

D:\Downloads>
D:\Downloads>wasmer run --dir . python-3.11.3.wasm
error: failed to run `python-3.11.3.wasm`
│   1: failed to instantiate WASI module
│   2: Instantiation failed
╰─▶ 3: Error while importing "wasi_snapshot_preview1"."sock_accept": unknown import. Expected Function(FunctionType { params: [I32, I32, I32], results: [I32] })

And I read https://wasmlabs.dev/articles/python-wasm32-wasi/, and it seems python-3.11.3.wasm can be run on wasmtime only and python-3.11.3-wasmedge.wasm can be run on wasmedge.

I have also problems when running on wasmedge on windows for --dir option. see WasmEdge/WasmEdge#1918.

D:\Downloads>wasmedge --dir /:D:/Downloads/ python-3.11.3-wasmedge.wasm
[2023-06-05 10:27:27.048] [error] Bind guest directory failed:44
^C
D:\Downloads>wasmedge --dir /:D:\Downloads\ python-3.11.3-wasmedge.wasm
[2023-06-05 10:27:37.568] [error] Bind guest directory failed:44
^C
D:\Downloads>
D:\Downloads>wasmtime run --mapdir /::D:/Downloads python-3.11.3.wasm
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 28 2023, 09:49:53) [Clang 15.0.7 ] on wasi
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
3
>>> exit()

D:\Downloads>

Is there any plans to support wasmer.

Describe the solution you'd like

N.A.

Describe alternatives you've considered

No response

Additional context

No response

@assambar
Copy link
Contributor

Hey @liudonghua123 thanks a lot for the interest and reporting this.
The problem comes form wasmer not being fully compliant to the latest preview1 ABI.

sock_accept got added some time after the initial preview1 release and is already supported by latest versions of major runtimes like wasmtime, wamr, wazero, node,js (listed in order I tried them).

We built python.wasm on top of wasi-libc which depends on this method.


As I see this has been fixed for the latest wasmer (and you have also verified it) - wasmerio/wasmer#3170

Therefore I will be closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants