-
-
Notifications
You must be signed in to change notification settings - Fork 904
Update Documentation for Emscripten Builds #1621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adqm
wants to merge
5
commits into
python:main
Choose a base branch
from
adqm:emscripten_build_instructions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
150a271
update documentation for emscripten builds
adqm 7a7c32a
remove emsdk version suggestion for cpython 3.13
adqm 144a72f
add make-mpdec step to the broken-out build commands
adqm 703a7a5
suggest python3 for Tools/wasm/emscripten commands
adqm 9fee316
bump EMSDK version for v3.14
adqm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -493,13 +493,26 @@ The simplest way to install the Emscripten compiler is: | |
|
||
# Install Emscripten | ||
git clone https://github.com/emscripten-core/emsdk | ||
./emsdk/emsdk install 4.0.5 | ||
./emsdk/emsdk activate 4.0.5 | ||
./emsdk/emsdk install 4.0.12 | ||
./emsdk/emsdk activate 4.0.12 | ||
source ./emsdk/emsdk_env.sh | ||
|
||
Updating the Emscripten compiler version often causes breakages. For the best | ||
compatibility, use the Emscripten version suggested in the cpython repository in | ||
``Tools/wasm/README.md``. | ||
Updating the Emscripten compiler version can cause breakages. For the best | ||
compatibility, use the appropriate Emscripten version based on the version of | ||
CPython you're building: | ||
|
||
* For building CPython 3.14, use ``emsdk`` version ``4.0.12``. | ||
* For building the main branch of the CPython repository, you may wish to use | ||
``latest`` instead of a specific version. | ||
|
||
It is possible (but not necessary) to enable ``ccache`` for Emscripten builds | ||
by setting the ``EM_COMPILER_WRAPPER`` environment, but this step will only | ||
take effect if it is done **after** ``emsdk_env.sh`` is sourced (otherwise, the | ||
sourced script removes the environment variable): | ||
|
||
.. code-block:: sh | ||
|
||
export EM_COMPILER_WRAPPER=ccache | ||
|
||
Building for Emscripten requires doing a cross-build where you have a *build* | ||
Python to help produce an Emscripten build of CPython. This means you build | ||
|
@@ -508,8 +521,8 @@ another that's the build you ultimately care about (that is, the build Python is | |
not meant for use by you directly, only the build system). | ||
|
||
The easiest way to get a debug build of CPython for Emscripten is to use the | ||
``Tools/wasm/emscripten build`` command (which should be run with a recent | ||
version of Python you have installed on your machine): | ||
``Tools/wasm/emscripten build`` command, which should be run with a recent | ||
version of Python (3.13 or newer) already installed on your machine: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been running it with 3.12 but it's harmless to say 3.13 here. |
||
|
||
.. code-block:: shell | ||
freakboy3742 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
@@ -524,11 +537,12 @@ is a convenience wrapper around the following commands: | |
|
||
.. code-block:: shell | ||
|
||
python Tools/wasm/emscripten configure-build-python --quiet -- --config-cache --with-pydebug | ||
python Tools/wasm/emscripten make-build-python --quiet | ||
python Tools/wasm/emscripten make-libffi --quiet | ||
python Tools/wasm/emscripten configure-host --quiet -- --config-cache | ||
python Tools/wasm/emscripten make-host --quiet | ||
python3 Tools/wasm/emscripten configure-build-python --quiet -- --config-cache --with-pydebug | ||
python3 Tools/wasm/emscripten make-build-python --quiet | ||
python3 Tools/wasm/emscripten make-libffi --quiet | ||
python3 Tools/wasm/emscripten make-mpdec --quiet | ||
python3 Tools/wasm/emscripten configure-host --quiet -- --config-cache | ||
python3 Tools/wasm/emscripten make-host --quiet | ||
|
||
.. note:: | ||
|
||
|
@@ -554,6 +568,9 @@ used in ``python.sh``: | |
|
||
make -C cross-build/wasm32-emscripten/build/python/ test | ||
|
||
Additional instructions for running the resulting builds (through Node.js and/or | ||
through web browsers) are available in the CPython repository at | ||
:cpy-file:`Tools/wasm/README.md`. | ||
|
||
.. _Emscripten: https://emscripten.org/ | ||
.. _WebAssembly: https://webassembly.org | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hoodmane This was the historical guidance for ccache... is it still required now that the
--config-cache
option is part of theemscripten build
script?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, compilation cache and configure cache are different things.