Skip to content

Commit 50dd71b

Browse files
Update WASI build instructions (#1752)
1 parent 9f2df6d commit 50dd71b

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

getting-started/setup-building.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ compiler just like building for :ref:`Unix <unix-compiling>` as well as:
379379

380380
1. A C compiler that can target WebAssembly (for example, `WASI SDK`_)
381381
2. A WASI host/runtime (for example, Wasmtime_)
382+
3. A system install of Python 3.11 or newer to run the build scripts
382383

383384
All of this is provided in the WASI :ref:`dev container <using-a-container>`
384385
(which you can select as an alternative container when using a
@@ -401,31 +402,43 @@ to have a version of Python for the build system to use and another that's the
401402
build you ultimately care about (that is, the build Python is not meant for use
402403
by you directly, only the build system).
403404

404-
The easiest way to get a debug build of CPython for WASI is to use the
405-
``Tools/wasm/wasi.py build`` command (which should be run w/ a recent version of
406-
Python you have installed on your machine):
405+
The easiest way to get a debug build of CPython for WASI is to run the
406+
following command with Python 3.11 or newer:
407407

408-
.. tab:: Python 3.14+
408+
.. tab:: Python 3.15+
409409

410410
.. code-block:: shell
411411
412-
python3 Tools/wasm/wasi build --quiet -- --config-cache --with-pydebug
412+
python Platforms/WASI build --quiet -- --config-cache --with-pydebug
413+
414+
.. tab:: Python 3.14
415+
416+
.. code-block:: shell
417+
418+
python Tools/wasm/wasi build --quiet -- --config-cache --with-pydebug
413419
414420
.. tab:: Python 3.13
415421

416422
.. code-block:: shell
417423
418-
python3 Tools/wasm/wasi.py build --quiet -- --config-cache --with-pydebug
424+
python Tools/wasm/wasi.py build --quiet -- --config-cache --with-pydebug
419425
420426
That single command will configure and build both the build Python and the
421-
WASI build in ``cross-build/build`` and ``cross-build/wasm32-wasip1``,
422-
respectively.
427+
WASI build in the ``cross-build/`` directory.
423428

424429
You can also do each configuration and build step separately; the command above
425430
is a convenience wrapper around the following commands:
426431

432+
.. tab:: Python 3.15+
433+
434+
.. code-block:: shell
435+
436+
$ python Platforms/WASI configure-build-python --quiet -- --config-cache --with-pydebug
437+
$ python Platforms/WASI make-build-python --quiet
438+
$ python Platforms/WASI configure-host --quiet -- --config-cache
439+
$ python Platforms/WASI make-host --quiet
427440
428-
.. tab:: Python 3.14+
441+
.. tab:: Python 3.14
429442

430443
.. code-block:: shell
431444
@@ -448,7 +461,7 @@ is a convenience wrapper around the following commands:
448461
The ``configure-host`` command infers the use of ``--with-pydebug`` from the
449462
build Python.
450463

451-
Running the separate commands after ``wasi build`` is useful if you, for example,
464+
Running the separate commands after ``build`` is useful if you, for example,
452465
only want to run the ``make-host`` step after making code changes.
453466

454467
Once everything is complete, there will be a

0 commit comments

Comments
 (0)