Open
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
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
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.