GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-156780: Emscripten: drop the trampoline's dependence on exports by clementperon · Pull Request #157238 · python/cpython

Conversation

@clementperon

@clementperon clementperon commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Split out of #156781 as requested by @hoodmane.

The call trampoline exports _PyRuntime's address itself and takes over a placeholder's function table slot instead of calling addFunction(), so it no longer needs _PyRuntime in -sEXPORTED_FUNCTIONS or -sALLOW_TABLE_GROWTH. __PyRuntime is dropped from the interpreter's export list.

Tested with the CI configuration: the wasm-gc trampoline is picked up and test_capi, test_builtin, test_functools pass.

  • Issue: Emscripten: static (non-MAIN_MODULE) builds fail at startup on dynamic-linking-only JS helpers #156780

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@clementperon
clementperon requested review from AA-Turner, corona10, emmatyping, erlend-aasland and itamaro as code owners September 9, 2026 21:19
@bedevere-app bedevere-app Bot mentioned this pull request Sep 9, 2026
Emscripten: static (non-MAIN_MODULE) builds fail at startup on dynamic-linking-only JS helpers #156780
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Sep 9, 2026
@clementperon

clementperon commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@freakboy3742 FYI

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hoodmane hoodmane added OS-emscripten skip news labels Sep 9, 2026
hoodmane
hoodmane approved these changes Sep 9, 2026
View reviewed changes

@hoodmane hoodmane left a comment

Copy link
Copy Markdown
Contributor

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.

Generally looks good to me, modulo a couple of comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Build/2026-09-09-21-10-00.gh-issue-156780.Kx7bYz.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/emscripten_trampoline.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Sep 9, 2026
hoodmane
hoodmane approved these changes Sep 9, 2026
View reviewed changes

@hoodmane hoodmane left a comment

Copy link
Copy Markdown
Contributor

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.

Looks reasonable to me aside from a couple of comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@clementperon
clementperon force-pushed the emscripten-trampoline-static branch 3 times, most recently from 0c9e930 to fe2b470 Compare September 10, 2026 08:19
@clementperon @claude
pythongh-156780: Emscripten: drop the trampoline's dependence on exports
0a2c8f4
The trampoline exports _PyRuntime's address itself and reuses a
placeholder's table slot, so libpython no longer needs
-sEXPORTED_FUNCTIONS=__PyRuntime or a growable function table.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@clementperon
clementperon force-pushed the emscripten-trampoline-static branch from 59ee601 to 0a2c8f4 Compare September 10, 2026 14:34
@clementperon clementperon mentioned this pull request Sep 10, 2026
gh-156780: Emscripten: support building CPython with static linking #156781
Merged
freakboy3742
freakboy3742 approved these changes Sep 11, 2026
View reviewed changes

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

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.

Looks good to me - Thanks!

Can I ask again that you don't force-push commits. We don't care about having a "clean" commit history, because we use merge commits when a PR is accepted; force pushes mean we lose context for review history.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clementperon reacted with eyes emoji
All reactions
  • 👀 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Sep 11, 2026
@freakboy3742
freakboy3742 merged commit d0b2e07 into python:main Sep 11, 2026
56 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 11, 2026
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@clementperon @claude @clin1234
pythongh-156780: Emscripten: drop the trampoline's dependence on expo…
2d83f1a
…rts (python#157238)

The trampoline exports _PyRuntime's address itself and reuses a
placeholder's table slot, so libpython no longer needs
-sEXPORTED_FUNCTIONS=__PyRuntime or a growable function table.

Co-authored-by: Claude Fable 5.1 <[email protected]>
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
@clementperon @claude @johnslavik
pythongh-156780: Emscripten: drop the trampoline's dependence on expo…
bebac0e
…rts (python#157238)

The trampoline exports _PyRuntime's address itself and reuses a
placeholder's table slot, so libpython no longer needs
-sEXPORTED_FUNCTIONS=__PyRuntime or a growable function table.

Co-authored-by: Claude Fable 5.1 <[email protected]>
@clementperon clementperon mentioned this pull request Oct 8, 2026
[depends][python][wasm] build and run a statically linked CPython xbmc/xbmc#29169
Merged
3 of 15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hoodmane hoodmane hoodmane approved these changes
@freakboy3742 freakboy3742 freakboy3742 approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@itamaro itamaro Awaiting requested review from itamaro itamaro is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

OS-emscripten skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@clementperon @freakboy3742 @hoodmane
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.