Skip to content

[docs] Fix claim that ccall just works from --pre-js/--post-js - #28477

Open
juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:docs_ccall_prejs
Open

juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:docs_ccall_prejs

Conversation

@juj

@juj juj commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Code in --pre-js and --post-js files does not automatically pull in JS library symbols such as ccall (see implicitSnippetDeps in src/jsifier.mjs). Building such code without extra settings produces a warning and fails at runtime with "ccall is not defined". Document that ccall must be exported via EXPORTED_RUNTIME_METHODS, or included via DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.

Code in --pre-js and --post-js files does not automatically pull in JS
library symbols such as ccall (see implicitSnippetDeps in
src/jsifier.mjs). Building such code without extra settings produces a
warning and fails at runtime with "ccall is not defined". Document that
ccall must be exported via EXPORTED_RUNTIME_METHODS, or included via
DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
``-sEXPORTED_RUNTIME_METHODS=ccall,cwrap``,
and call it on ``Module`` (which contains
everything exported, in a safe way that is not influenced by minification
or optimizations).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I support we could instead add ccall to implicitSnippetDeps ?

But I guess its easier to just update the docs to match the status quo

This branch has not been deployed

No deployments
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.

2 participants