Skip to content

Enable -m test for wasi #4583

Description

@youknowone

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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