python / python/cpython

Emscripten settings in configure.ac are not embedding friendly

Open
#120,746 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-emscripten type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

I would like to be able to opt out of certain Emscripten options since I am embedded CPython in a larger application. For example, the forced inclusion of the JS file system is breaking my builds since I use WASMFS in my system which isn't compatible with -lidbfs.js, -lnodefs.js, -lproxyfs.js, -lworkerfs.js. Moreover, I would like to customise the TOTAL_MEMORY option.

Perhaps these options can be on by default but placed behind a flag that can turn them off? For example, --enable-wasm-emscripten-jsfs? Alternatively, perhaps all these settings can be disabled unless one of node, browser, node-debug, browser-debug is set via --with_emscripten_target?

Right now, it seems my only option is to apply a patch to turn these settings off which should be unnecessary in my opinion. @hoodmane @vstinner what do you think?

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading configure.ac around lines 2340-2351 and the existing --with_emscripten_target handling. Determine how the Emscripten JavaScript filesystem options and TOTAL_MEMORY are currently set, then define how embedded builds can opt out or customize them. Done means the requested settings can be controlled without maintaining a patch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, wasm
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.