Skip to content

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
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

adqm
Copy link

@adqm adqm commented Aug 2, 2025

This patch includes some updates to the instructions for building for Emscripten, based on discussion from python/cpython#137312 and python/cpython#137025, with the goal of reducing duplicated information between the dev guide and Tools/wasm/README.md in the CPython repo.

Specifically, this patch makes the following changes:

  • updates emsdk version information

  • links to Tools/wasm/README.md for usage instructions beyond what's shown here

  • adds a note about ccache

  • adds a note about minimum Python version required for Tools/wasm/emscripten build


📚 Documentation preview 📚: https://cpython-devguide--1621.org.readthedocs.build/

* update emsdk version information

* link to `Tools/wasm/README.md` for usage instructions beyond what's shown here

* add note about ccache

* add note about minimum Python version for `Tools/wasm/emscripten build`
Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; a couple of minor corrections/clarifications inline.

``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:

.. code-block:: shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment on he code block below - but there's now one more build step - make-mpdec (same general structure as the make-libffi call).

As a longer term maintenance issue, this list of subcommands is likely to change over time; the dev guide should always have the instructions for the current state of main, but it might be worth flagging that some of the steps might not exist on older Python versions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. I missed that change. I'll update the code block to match the current steps.

That addition looks like it was backported to 3.14, so maybe not an urgent question, but I do agree that it's worth thinking through how best to label version-specific steps.

It would be great to have this generated automatically, but I'm not sure how best to do that (you could imagine adding a command to Tools/wasm/emscripten that outputs these steps rather than hard-coding them in the dev guide, but that doesn't feel particularly great). For now I'll just update the list of commands here.

CPython you're building:

* For building CPython 3.14, use ``emsdk`` version ``4.0.11``.
* For building CPython 3.13, use ``emsdk`` version ``4.0.5``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't correct... but I don't know what is correct. I'm fairly certian it's 3.something...

However, it might be better to leave this line off entirely. Emscripten isn't Tier 3 for 3.13. Having specific build instructions implies (to me) that it should work, and that definitely won't be the case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good to me; sorry for the error! Makes sense only to include it for 3.14+.

Comment on lines +509 to +512
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):
Copy link
Contributor

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 the emscripten build script?

@hoodmane
Copy link
Contributor

hoodmane commented Aug 3, 2025

I'll review this tomorrow. Thanks @adqm !

@python python deleted a comment from hoodmane Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy