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: add missing EM_JS_DEPS by clementperon · Pull Request #156798 · python/cpython

Conversation

@clementperon

@clementperon clementperon commented Sep 1, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Split out of #156781, as suggested by @hoodmane.

EM_JS bodies are emitted verbatim, so Emscripten's dependency tracker cannot see the JS symbols they reference and silently omits them.

Declared here: $FS, $PATH, $FS_getMode, $resolveGlobalSymbol and emscripten_exit_with_live_runtime in emscripten_syscalls.c, and $wasmTable, $wasmMemory, $addFunction, $addOnPreRun in emscripten_trampoline.c.

No change for MAIN_MODULE builds. Without it, the link now fails with

error: undefined symbol: $resolveGlobalSymbol

instead of a ReferenceError during initRuntime.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Sep 1, 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 1, 2026
@clementperon

clementperon commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@hoodmane first PR that add the EM_JS_DEPS() everywhere

All reactions

Sorry, something went wrong.

Uh oh!

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

hoodmane
hoodmane approved these changes Sep 1, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Sep 1, 2026
@hoodmane hoodmane added skip news OS-emscripten labels Sep 1, 2026
@clementperon
clementperon force-pushed the emscripten-em-js-deps branch from 259acbf to 692abd8 Compare September 1, 2026 21:34
@clementperon
clementperon requested a review from ericsnowcurrently as a code owner September 1, 2026 21:34
hoodmane
hoodmane reviewed Sep 1, 2026
View reviewed changes
Comment thread Misc/NEWS.d/next/Build/2026-09-01-23-32-01.gh-issue-156780.Kz8vQr.rst Resolved

Uh oh!

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

@clementperon
clementperon force-pushed the emscripten-em-js-deps branch from 692abd8 to f770de5 Compare September 1, 2026 21:41
@freakboy3742

freakboy3742 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Noting that CI is currently failing because of a duplicated symbol; that seems to suggest there's a need to collate these declarations into a single coherent location so that we can avoid duplication, rather than co-locating them with usage.

Also - can I ask that you please don't force push. We don't care about a "messy" commit history; CPython uses merge commits, so any messy history isn't preserved after merge. Force pushes also mean that we can lose the context for review comments, and it's really easy to force push a merge comment that pings the entire core team for comment.

All reactions

Sorry, something went wrong.

Uh oh!

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

@hoodmane

hoodmane commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Emscripten's normal style guide is to put these next to the symbol that uses them so I think that's alright. I think we have a conflict with #156335, need to merge a main that includes that commit and fix the duplicate symbol.

All reactions

Sorry, something went wrong.

Uh oh!

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

@clementperon @claude
pythongh-156780: Emscripten: add missing EM_JS_DEPS
18a9541
EM_JS bodies are emitted verbatim, so Emscripten cannot see the JS symbols
they reference. Declare them.

Co-Authored-By: Claude Opus 5 <[email protected]>
@clementperon
clementperon force-pushed the emscripten-em-js-deps branch from 8015a97 to 18a9541 Compare September 2, 2026 08:26
@clementperon

clementperon commented Sep 2, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

@freakboy3742 "Noting that CI is currently failing because of a duplicated symbol" ?

The build fail no?
Something like

dup.c >>>
EM_JS_DEPS(tag_a, "$FS");

EM_JS_DEPS(tag_a, "$PATH");  

dup.c:3:1: error: redefinition of '__em_lib_deps_tag_a'
dup.c:1:1: note: previous definition is here

The issue here is that my fork was not up to date with main.

Also about the force push well noted, I had to do it here to properly rebase on latest master

All reactions

Sorry, something went wrong.

Uh oh!

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

@clementperon clementperon mentioned this pull request Sep 3, 2026
[depends][python][wasm] build and run a statically linked CPython xbmc/xbmc#29169
Merged
3 of 15 tasks
freakboy3742
freakboy3742 approved these changes Sep 8, 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.

Ok - if Emscripten convention is to keep the declarations locally, then it makes sense for us to do the same.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Sep 8, 2026
@freakboy3742
freakboy3742 merged commit 0b3b154 into python:main Sep 8, 2026
96 of 98 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 8, 2026
@bedevere-bot

bedevere-bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Debian Non-Debug with X 3.x (tierless) has failed when building commit 0b3b154.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1245/builds/9398) and take a look at the build logs.
  4. Check if the failure is related to this commit (0b3b154) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1245/builds/9398

Summary of the results of the build (if available):

==

Click to see traceback logs
Note: switching to '0b3b154060936e1b120f5b9793ed3f8647df8480'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 0b3b15406093 gh-156780: Emscripten: add missing EM_JS_DEPS (#156798)
Switched to and reset branch 'main'

configure: WARNING: i686-pc-linux-gnu/gcc is not supported
configure: WARNING:

Platform "i686-pc-linux-gnu" with compiler "gcc" is not supported by the
CPython core team, see https://peps.python.org/pep-0011/ for more information.


Objects/moduleobject.c: In function ‘module_from_slots_and_spec’:
Objects/moduleobject.c:412:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  412 |     uint64_t multiple_interpreters = (uint64_t)Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED;
      |                                      ^
Objects/moduleobject.c:474:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  474 |                     requires_gil = (val != (uint64_t)Py_MOD_GIL_NOT_USED);
      |                                            ^
In file included from Objects/mimalloc/static.c:26,
                 from Objects/obmalloc.c:26:
Objects/mimalloc/arena.c:59:1: note: the alignment of ‘_Atomic long long int’ fields changed in GCC 11.1
   59 | } mi_arena_t;
      | ^
Python/ceval.c: In function ‘_Py_BuildMap_StackRefSteal’:
Python/ceval.c:943:11: warning: ‘args_o_temp’ may be used uninitialized [-Wmaybe-uninitialized]
  943 |     res = _PyDict_FromItems(
      |           ^~~~~~~~~~~~~~~~~~
  944 |         args_o, 2,
      |         ~~~~~~~~~~
  945 |         args_o+1, 2,
      |         ~~~~~~~~~~~~
  946 |         half_args
      |         ~~~~~~~~~
  947 |     );
      |     ~      
In file included from Python/ceval.h:11,
                 from Python/ceval.c:3:
./Include/internal/pycore_dict.h:333:23: note: by argument 3 of type ‘PyObject * const*’ {aka ‘struct _object * const*’} to ‘_PyDict_FromItems’ declared here
  333 | PyAPI_FUNC(PyObject *)_PyDict_FromItems(
      |                       ^~~~~~~~~~~~~~~~~
In file included from Python/ceval.c:702:
Python/ceval.c:938:52: note: ‘args_o_temp’ declared here
  938 |     STACKREFS_TO_PYOBJECTS(arguments, half_args*2, args_o);
      |                                                    ^~~~~~
Python/ceval_macros.h:522:15: note: in definition of macro ‘STACKREFS_TO_PYOBJECTS’
  522 |     PyObject *NAME##_temp[MAX_STACKREF_SCRATCH+1]; \
      |               ^~~~
./Modules/_remote_debugging/binary_io_reader.c: In function ‘binary_reader_replay’:
./Modules/_remote_debugging/binary_io_reader.c:1250:55: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
 1250 |             if (replayed % PROGRESS_CALLBACK_INTERVAL < count) {
      |                                                       ^
./Modules/_sqlite/connection.c: In function ‘deserialize_impl’:
./Modules/_sqlite/connection.c:2352:19: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 2352 |     if (data->len > 9223372036854775807) {  // (1 << 63) - 1
      |                   ^
./Modules/_testlimitedcapi/heaptype_relative.c: In function ‘make_sized_heaptypes’:
./Modules/_testlimitedcapi/heaptype_relative.c:71:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   71 |                            (unsigned long long)data_ptr,
      |                            ^

make: *** [Makefile:2481: buildbottest] Error 3
All reactions

Sorry, something went wrong.

Uh oh!

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

maurycy added a commit to maurycy/cpython that referenced this pull request Sep 10, 2026
@maurycy
Merge branch 'main' into tachyon-native-callable
e028ff5
* main: (158 commits)
  pythongh-156924: Try reifying lazy imports in `ForwarRef.evaluate()` (python#156940)
  pythongh-156233: Fix typos and code snippet errors in the docs (python#156475)
  pythongh-156837: Refer to yield expressions in generator function definitions (pythonGH-156863)
  pythongh-155292: Skip updating unicodedata with mismatched interpreter (pythonGH-157066)
  pythongh-157170: Document the scope of global curses settings (pythonGH-157207)
  pythongh-155966: Correct handling of `math.tanpi` poles (python#155980)
  pythongh-157170: Restore use_env() after test_use_prescr_screen in test_curses (pythonGH-157171)
  pythongh-156910: fix deadlock in type_set_abstractmethods under free-threading (python#156948)
  pythongh-155648: Write the empty and placeholder IDLE tests (python#156260)
  pythongh-153569: centralize formatted-string state and source spans (python#156484)
  pythongh-157137: Mark the PEP 820 soft deprecations as 3.15, not `next` (python#157138)
  pythongh-152433: Use regular LoadLibrary in UWP for Windows system libs (pythonGH-156972)
  pythongh-121617: Fix Py_CLEAR() memcpy in C++: replace NULL with _Py_NULL (python#157188)
  pythongh-157135: Fix documentation errors in the `math.atan{2}pi` functions (python#157136)
  pythongh-121617: Fix Py_CLEAR() in C++: replace NULL with _Py_NULL (python#157067)
  pythongh-156774: Speed up pdb startup with asyncio guard (python#156775)
  pythongh-156109: Allow static, non-framework iOS builds (python#156110)
  pythongh-156780: Emscripten: add missing EM_JS_DEPS (python#156798)
  pythongh-152936: Make privileged functions available on Android (python#152977)
  pythongh-123018: Keep the libedit history file header when truncating (pythonGH-157165)
  ...
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@clementperon @claude @clin1234
pythongh-156780: Emscripten: add missing EM_JS_DEPS (python#156798)
c3896d2
Explicitly declares some Javascript dependencies to support static builds.

Co-authored-by: Claude Opus 5 <[email protected]>
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
@clementperon @claude @johnslavik
pythongh-156780: Emscripten: add missing EM_JS_DEPS (python#156798)
878d8f0
Explicitly declares some Javascript dependencies to support static builds.

Co-authored-by: Claude Opus 5 <[email protected]>
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
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently

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.

4 participants

@clementperon @freakboy3742 @hoodmane @bedevere-bot
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.