FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 by hoodmane · Pull Request #145038 · python/cpython · GitHub

/ cpython Public

gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19 - #145038

Merged
freakboy3742 merged 2 commits into
python:mainfrom
hoodmane:emscripten-trampoline-pointer
Feb 25, 2026
Merged

gh-145037: Fix Emscripten trampoline with emcc >= 4.0.19#145038
freakboy3742 merged 2 commits into
python:mainfrom
hoodmane:emscripten-trampoline-pointer

Conversation

hoodmane commented Feb 20, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

This undoes a change made as a part of #137470. We add an emscripten_trampoline field in pycore_runtime_structs.h and initialize it from JS initialization code with the wasm-gc based trampoline if possible. Otherwise we fall back to the JS trampoline.

cc @freakboy3742 @ryanking13

This undoes a change made as a part of PR 137470. We add an `emscripten_trampoline`
field in `pycore_runtime_structs.h` and initialize it from JS initialization code with
the wasm-gc based trampoline if possible. Otherwise we fall back to the JS trampoline.
hoodmane force-pushed the emscripten-trampoline-pointer branch from 200d8fe to 526e102 Compare February 20, 2026 15:39
hoodmane added OS-emscripten interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Feb 20, 2026

Copy link
Copy Markdown
Contributor

!buildbot emscripten

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 526e102 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145038%2Fmerge

The command will test the builders whose names match following regular expression: emscripten

The builders matched are:

  • WASM Emscripten PR

Copy link
Copy Markdown
Contributor

@hoodmane Not sure what is going on here, but this has broken the Emscripten buildbot.

Copy link
Copy Markdown
Contributor Author

Looks like there are some mistakes to fix here.

Copy link
Copy Markdown
Contributor Author

!buildbot emscripten

I think it should be better now.

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @hoodmane for commit f3d03d3 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145038%2Fmerge

The command will test the builders whose names match following regular expression: emscripten

The builders matched are:

  • WASM Emscripten PR

Copy link
Copy Markdown
Contributor Author

Okay now it is better.

freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this makes sense; one detail flagged inline that I want to confirm before approving.

PyObject* self,
PyObject* args,
PyObject* kw);
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is the only part that gives me pause - I'm not sure if the specific offsets inside this structure are something that have consequences. There's no explicit CODEOWNERS reference for this file; @ericsnowcurrently has a few close-by entries, and @markshannon has most of the git blames

For the two of you - are there any offset/ordering concerns in pyruntimestate (even if just from a code organization perspective) that we should be concern about here?

Or if CODEOWNERS/git blame has mislead me... any idea who I should be asking?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Are you suggesting I should add this at the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also, #137470 changed this header without problem, so if there is someone relying on offsets in this struct they started doing so after then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure if the end is a better place - I was mostly checking with Eric/Mark to see if there were any conventions I wasn't (but should be) aware of. But given the history from #137470, maybe I'm overthinking it.

freakboy3742 merged commit 43fdb70 into python:main Feb 25, 2026
49 checks passed

Copy link
Copy Markdown
Contributor Author

Thanks for the review @freakboy3742 !

hoodmane deleted the emscripten-trampoline-pointer branch February 26, 2026 07:35

Copy link
Copy Markdown
Contributor Author

Can we backport to 3.14.x?

freakboy3742 added the needs backport to 3.14 bugs and security fixes label Feb 26, 2026

Copy link
Copy Markdown

Thanks @hoodmane for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 26, 2026
…nGH-145038)

This undoes a change made as a part of PR 137470, for compatibility with EMSDK
4.0.19. It adds `emscripten_trampoline` field in `pycore_runtime_structs.h`
and initializes it from JS initialization code with the wasm-gc based trampoline
if possible. Otherwise we fall back to the JS trampoline.
(cherry picked from commit 43fdb70)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>

bedevere-app Bot commented Feb 26, 2026

Copy link
Copy Markdown

GH-145283 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Feb 26, 2026

Copy link
Copy Markdown
Contributor

I wasn't sure if a backport was needed, since 3.14 is theoretically locked at 4.0.9; but I guess it doesn't hurt to allow for forwards compatibility.

freakboy3742 pushed a commit that referenced this pull request Feb 27, 2026
…45038) (#145283)

This undoes a change made as a part of PR 137470, for compatibility with EMSDK
4.0.19. It adds `emscripten_trampoline` field in `pycore_runtime_structs.h`
and initializes it from JS initialization code with the wasm-gc based trampoline
if possible. Otherwise we fall back to the JS trampoline.
(cherry picked from commit 43fdb70)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
…n#145038)

This undoes a change made as a part of PR 137470, for compatibility with EMSDK
4.0.19. It adds `emscripten_trampoline` field in `pycore_runtime_structs.h`
and initializes it from JS initialization code with the wasm-gc based trampoline
if possible. Otherwise we fall back to the JS trampoline.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…n#145038)

This undoes a change made as a part of PR 137470, for compatibility with EMSDK
4.0.19. It adds `emscripten_trampoline` field in `pycore_runtime_structs.h`
and initializes it from JS initialization code with the wasm-gc based trampoline
if possible. Otherwise we fall back to the JS trampoline.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-emscripten skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL