Skip to content

Allow Subinterpreters on WASI/Emscripten Builds #135190

Description

@ericsnowcurrently

Currently using multiple interpreters on WASI and Emscripten builds is disallowed. This is reflected in various places, including configure, the test suite, and the docs. I don't recall why the feature was disallowed (maybe confusion about a relationship with threads?), but there shouldn't be any need to disallow them.

CC @brettcannon

Activity

  1. added
    testsTests in the Lib/test dir
    docsDocumentation in the Doc dir
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    stdlibStandard Library Python modules in the Lib/ directory
    on Jun 5, 2025
  2. brettcannon commented on Jun 5, 2025

    @brettcannon
    Member

    Do the tests require processes for any reason? Otherwise I don't remember explicitly turning them off.

  3. freakboy3742 commented on Jun 5, 2025

    @freakboy3742
    Contributor

    @hoodmane can confirm, but IIRC, on Emscripten, the restriction is the lack of threads (or, at least, the decision to disable the limited thread support that is available on Emscripten because of security and compatibility concerns).

  4. hoodmane commented on Jun 5, 2025

    @hoodmane
    Contributor

    Yeah, threads don't work very well with dynamic linking on Emscripten. I think as long as you first load dynamic libraries, then start threads it's probably okay. But it's complex to support and I don't personally care enough. Subinterpreters don't seem like they can be all that useful without threading.

  5. ZeroIntensity commented on Jun 6, 2025

    @ZeroIntensity
    Member

    There are definitely some use cases for subinterpreters outside concurrency. There's some discussion surrounding this on the PEP 734 acceptance yesterday. I think the clearest one is that you can change sys.path to allow conflicting versions of dependencies to be loaded in the same process.

  6. brettcannon commented on Jun 26, 2025

    @brettcannon
    Member

    @ericsnowcurrently are you planning to try and turn on support or waiting on someone else to do it?

  7. ericsnowcurrently commented on Jun 26, 2025

    @ericsnowcurrently
    MemberAuthor

    I haven't had time to think about it much. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15bugs and security fixesOS-emscriptenOS-wasidocsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)stdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirtopic-subinterpreters

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions