-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
platform: wasm/wasirelated to WebAssembly supportrelated to WebAssembly supporttype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Description
What's the problem this feature will solve?
I'm trying to run pytest under the WASI build of CPython, but pytest's extensive use of os.dup()
prevents it from working.
If you're curious to reproduce:
- Grab a WASI build from https://github.com/tiran/cpython-wasm-test/releases
- Unpack it somewhere
- From the same directory where you unpacked
python.wasm
:PIP_REQUIRE_VIRTUALENV=0 py -3.11 -m pip install --target . --only-binary=:all: --implementation=py --abi=none --abi=any pytest
(if you don't have the Python Launcher, take out-3.11
and add the pip flag--python_version="3.11"
) - Try running
wasmtime run --dir=. python.wasm -- -m pytest -h
It looks like:
Line 381 in 03b1994
self.targetfd_save = os.dup(targetfd) |
is the first instance of os.dup()
you run into, but even with --capture=no
/s
, you still run into:
pytest/src/_pytest/faulthandler.py
Line 29 in 61cfaac
stderr_fd_copy = os.dup(get_stderr_fileno()) |
Describe the solution you'd like
I would love to be able to provide instructions to projects on how to run pytest under WASI to see if their project is compatible.
Alternative Solutions
Additional context
Metadata
Metadata
Assignees
Labels
platform: wasm/wasirelated to WebAssembly supportrelated to WebAssembly supporttype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch