Skip to content

Commit 4054552

Browse files
committed
pythongh-95853: Multiple ops and debug for wasm_build.py
- `wasm_build.py` now supports multiple operations. - only `build` (default) performs auto-building - new ops `configure` and `compile`. - better help - `repl` starts `wasm_webserver` and opens browser repl - `test` and `hostrunnertest` now support custom testopts
1 parent d5e0786 commit 4054552

File tree

3 files changed

+206
-72
lines changed

3 files changed

+206
-72
lines changed

Makefile.pre.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,10 @@ buildbottest: all
17181718
fi
17191719
$(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)
17201720

1721+
# Like testall, but run Python tests with HOSTRUNNER directly.
1722+
hostrunnertest: all
1723+
$(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test -u all $(TESTOPTS)
1724+
17211725
pythoninfo: all
17221726
$(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test.pythoninfo
17231727

Tools/wasm/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Python WebAssembly (WASM) build
22

3-
**WARNING: WASM support is highly experimental! Lots of features are not working yet.**
3+
**WARNING: WASM support is still experimental! Lots of features are not working yet.**
44

55
This directory contains configuration and helpers to facilitate cross
6-
compilation of CPython to WebAssembly (WASM). For now we support
7-
*wasm32-emscripten* builds for modern browser and for *Node.js*. WASI
8-
(*wasm32-wasi*) is work-in-progress
6+
compilation of CPython to WebAssembly (WASM). Python supports Emscripten
7+
(*wasm32-emscripten*) and WASI (*wasm32-wasi*) targets. Emscripten builds
8+
run in modern browsers and JavaScript runtimes like *Node.js*. WASI builds
9+
use WASM runtimes such as *wasmtime*.
10+
11+
Users and developers are encouraged to use the script
12+
`Tools/wasm/wasm_build.py`. The tool automates the build process and provides
13+
assistance with installation of SDKs.
914

1015
## wasm32-emscripten build
1116

@@ -17,7 +22,7 @@ access the file system directly.
1722

1823
Cross compiling to the wasm32-emscripten platform needs the
1924
[Emscripten](https://emscripten.org/) SDK and a build Python interpreter.
20-
Emscripten 3.1.8 or newer are recommended. All commands below are relative
25+
Emscripten 3.1.19 or newer are recommended. All commands below are relative
2126
to a repository checkout.
2227

2328
Christian Heimes maintains a container image with Emscripten SDK, Python
@@ -471,6 +476,8 @@ ln -srf -t /usr/local/bin/ ~/.wasmtime/bin/wasmtime
471476

472477
### WASI debugging
473478

474-
* ``wasmtime run -g`` generates debugging symbols for gdb and lldb.
479+
* ``wasmtime run -g`` generates debugging symbols for gdb and lldb. The
480+
feature is currently broken, see
481+
https://github.com/bytecodealliance/wasmtime/issues/4669
475482
* The environment variable ``RUST_LOG=wasi_common`` enables debug and
476483
trace logging.

0 commit comments

Comments
 (0)