Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Enable -m test for wasi #4583

Copy link
Copy link
Open
Open
Copy link
@youknowone

Description

@youknowone
Issue body actions

Requirements:

Feature

Due to enhancement of wasi support of python libraries, we now also can do it!

How to

Build wasi binary:

cargo build --target wasm32-wasi --no-default-features --features freeze-stdlib,stdlib --release

You will need to install wasm32-wasi target using rustup.

Run test:

wasmer run --dir . target/wasm32-wasi/release/rustpython.wasm -- -m test test_support

You will need to install wasmtime or wasmer to run it.

Current result:

...
  File "test.support", line 16, in <module>
  File "unittest", line 66, in <module>
  File "unittest.main", line 8, in <module>
  File "unittest.runner", line 9, in <module>
  File "unittest.signals", line 1, in <module>
  File "signal", line 1, in <module>
ModuleNotFoundError: No module named '_signal'

It doesn't work. Because we don't have _signal module for wasi yet, while cpython does have.

To run cpython wasi build, I used this article as reference:
https://snarky.ca/testing-a-project-using-the-wasi-build-of-cpython-with-pytest/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.