Skip to content

ci: bump emscripten build to 3.14#5455

Merged
davidhewitt merged 12 commits intoPyO3:mainfrom
davidhewitt:emscripten-313
Mar 13, 2026
Merged

ci: bump emscripten build to 3.14#5455
davidhewitt merged 12 commits intoPyO3:mainfrom
davidhewitt:emscripten-313

Conversation

@davidhewitt
Copy link
Member

Attempts to update the emscripten build to 3.13.

@davidhewitt davidhewitt marked this pull request as draft October 8, 2025 14:34
@davidhewitt davidhewitt changed the title ci: bump emscripten build to 3.13 ci: bump emscripten build to 3.14 Mar 12, 2026
Copy link
Member Author

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

🎉 I've managed to get this working with 3.14!

cd $(PYTHONBUILD)/cross-build/wasm32-emscripten/build/python && \
source $(EMSDKDIR)/emsdk_env.sh && \
emar rcs Modules/_hacl/libhacl.a Modules/_hacl/*.o
# Copy all .a libraries
Copy link
Member Author

Choose a reason for hiding this comment

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

cc @hoodmane have you run into this with pyodide? I suspect I'm somehow misconfiguring the build.

Copy link
Member Author

Choose a reason for hiding this comment

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

"This" being needing to manually link the hacl modules in because the Tools script is missing them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we have problems with libmpdec and libexpat too but hacl is the worst.

@davidhewitt davidhewitt marked this pull request as ready for review March 12, 2026 15:31

PYTHONLIBDIR=$(BUILDROOT)/install/Python-$(PYVERSION)/lib

CROSS_PYTHON=$(PYTHONBUILD)/cross-build/wasm32-emscripten/build/python/python.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that we are discussing moving some of these things. Should hopefully only be a minor annoyance for you though.

$(EMSDKDIR)/emsdk_env.sh: $(BUILDROOT)/.exists $(PYTHONBUILD)/.patched
# NB: future Python versions will stash emscripten version in config.toml
# EMSCRIPTEN_VERSION=$$(python -c "import tomllib; print(tomllib.load(open('$(PYTHONBUILD)/Tools/wasm/emscripten/config.toml', 'rb'))['emscripten-version'])")
EMSCRIPTEN_VERSION=4.0.12 && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe 5.0.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was following https://devguide.python.org/getting-started/setup-building/#emscripten, which says to use 4.0.12 for 3.14

# NB: future Python versions will stash emscripten version in config.toml
# EMSCRIPTEN_VERSION=$$(python -c "import tomllib; print(tomllib.load(open('$(PYTHONBUILD)/Tools/wasm/emscripten/config.toml', 'rb'))['emscripten-version'])")
EMSCRIPTEN_VERSION=4.0.12 && \
git clone https://github.com/emscripten-core/emsdk.git --depth 1 --branch $$EMSCRIPTEN_VERSION $(EMSDKDIR) && \
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just clone the latest

git clone https://github.com/emscripten-core/emsdk.git --depth 1 $(EMSDKDIR)

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually if you're willing to use the tip of the 3.14 branch, I've automated the installation of emscripten and you could get rid of all of this and use:

python$(PYMAJORMINOR) Tools/wasm/emscripten build --quiet --emsdk-cache=./emsdk-cache

and it will install emscripten for you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah nice, I managed to get that working 👍

@davidhewitt
Copy link
Member Author

I think this is ready to merge, will probably do so later unless anyone has concerns (a CI-only change).

Copy link
Member

@bschoenmaeckers bschoenmaeckers left a comment

Choose a reason for hiding this comment

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

Nice seeing this getting less complicated 👍

@davidhewitt davidhewitt added this pull request to the merge queue Mar 13, 2026
Merged via the queue into PyO3:main with commit c0de3eb Mar 13, 2026
90 checks passed
@davidhewitt davidhewitt deleted the emscripten-313 branch March 13, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants