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 — bpo-40280: Add --enable-wasm-dynamic-linking (GH-32253) by tiran · Pull Request #32253 · python/cpython

bpo-40280: Add --enable-wasm-dynamic-linking (GH-32253) #32253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
tiran merged 5 commits into python:main from tiran:bpo-40280-wasm-dynamic-linking
Apr 4, 2022

Uh oh!

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

Merged

bpo-40280: Add --enable-wasm-dynamic-linking (GH-32253) #32253

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
dbc74ad
bpo-40280: Add --enable-wasm-dynamic-linking
tiran Apr 2, 2022
9d5b67a
Set to missing, add breadcrumbs for WASI
tiran Apr 2, 2022
17998ea
Typo
tiran Apr 2, 2022
09e5ecf
Tab vs. space
tiran Apr 2, 2022
c1a4260
Drop space between -s and argument
tiran Apr 3, 2022
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view

There are no files selected for viewing

29 changes: 26 additions & 3 deletions 29 Doc/using/configure.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ General Options
Set the Python executable suffix to *SUFFIX*.

The default suffix is ``.exe`` on Windows and macOS (``python.exe``
executable), ``.wasm`` on Emscripten (``python.wasm`` executable), and
an empty string on other platforms (``python`` executable).
executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser,
``.wasm`` on WASI, and an empty string on other platforms (``python``
executable).

.. versionchanged:: 3.11
The default suffix on Emscripten platform is ``.wasm``.
The default suffix on WASM platform is one of ``.js``, ``.html``
or ``.wasm``.

.. cmdoption:: --with-tzpath=<list of absolute paths separated by pathsep>

Expand Down Expand Up @@ -141,6 +143,27 @@ General Options

.. versionadded:: 3.11

WebAssemby Options
------------------

.. cmdoption:: --with-emscripten-target=[browser|node]

Set build flavor for ``wasm32-emscripten``.

* ``browser`` (default): preload minimal stdlib, default MEMFS.
* ``node``: NODERAWFS and pthread support.

.. versionadded:: 3.11

.. cmdoption:: --enable-wasm-dynamic-linking

Turn on dynamic linking support for WASM.

Dynamic linking enables ``dlopen``. File size of the executable
increases due to limited dead code elimination and additional features.

.. versionadded:: 3.11


Install Options
---------------
Expand Down
2 changes: 2 additions & 0 deletions 2 Misc/NEWS.d/next/Build/2022-04-02-17-52-38.bpo-40280.U8Dd0H.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add configure option :option:`--enable-wasm-dynamic-linking` to enable
``dlopen`` and MAIN_MODULE / SIDE_MODULE on ``wasm32-emscripten``.
23 changes: 11 additions & 12 deletions 23 Tools/wasm/README.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,31 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri

## wasm32-emscripten limitations and issues

- Heap and stack are limited.
- Most stdlib modules with a dependency on external libraries are missing:
``ctypes``, ``readline``, ``sqlite3``, ``ssl``, and more.
- Shared extension modules are not implemented yet. All extension modules
are statically linked into the main binary.
The experimental configure option ``--enable-wasm-dynamic-linking`` enables
dynamic extensions.
- Processes are not supported. System calls like fork, popen, and subprocess
fail with ``ENOSYS`` or ``ENOSUP``.
- Only ``AF_INET`` and ``AF_INET6`` with ``SOCK_STREAM`` (TCP) or
``SOCK_DGRAM`` (UDP) are available. ``AF_UNIX`` is not supported.
- ``socketpair`` does not work.
- Blocking sockets are not available and non-blocking sockets don't work
correctly, e.g. ``socket.accept`` crashes the runtime. ``gethostbyname``
does not resolve to a real IP address. IPv6 is not available.
- The ``select`` module is limited. ``select.select()`` crashes the runtime
due to lack of exectfd support.
- The ``*at`` variants of functions (e.g. ``openat``) are not available.
The ``dir_fd`` argument of *os* module functions can't be used.
- Signal support is limited. ``signal.alarm``, ``itimer``, ``sigaction``
are not available or do not work correctly. ``SIGTERM`` exits the runtime.
- Most user, group, and permission related function and modules are not
supported or don't work as expected, e.g.``pwd`` module, ``grp`` module,
``os.setgroups``, ``os.chown``, and so on.
``os.setgroups``, ``os.chown``, and so on. ``lchown`` and `lchmod`` are
not available.
- ``umask`` is a no-op.
- hard links (``os.link``) are not supported.
- Offset and iovec I/O functions (e.g. ``os.pread``, ``os.preadv``) are not
available.
- ``os.mknod`` and ``os.mkfifo``
Expand All @@ -108,17 +115,9 @@ node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscri
- ``mmap`` module is unstable. flush (``msync``) can crash the runtime.
- Resource-related functions like ``os.nice`` and most functions of the
``resource`` module are not available.
- Some time and datetime features are broken. ``strftime`` and ``strptime``
have known bugs, e.g.
[%% quoting](https://github.com/emscripten-core/emscripten/issues/16155),
[%U off-by-one](https://github.com/emscripten-core/emscripten/issues/16156).
Extended glibc formatting features are not available.
- glibc extensions for date and time formatting are not available.
- ``locales`` module is affected by musl libc issues,
[bpo-46390](https://bugs.python.org/issue46390).
- ``uuid`` module is affected by
[memory leak](https://github.com/emscripten-core/emscripten/issues/16081)
and crasher in Emscripten's ``freeaddrinfo``,
- Recursive ``glob`` leaks file descriptors.
- Python's object allocator ``obmalloc`` is disabled by default.
- ``ensurepip`` is not available.

Expand Down
4 changes: 0 additions & 4 deletions 4 Tools/wasm/config.site-wasm32-emscripten
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,3 @@ ac_cv_func_linkat=no

# alarm signal is not delivered, may need a callback into the event loop?
ac_cv_func_alarm=no

# To use dlopen, you need to use Emscripten's linking support,
# see https://emscripten.org/docs/compiling/Dynamic-Linking.html
ac_cv_func_dlopen=no
104 changes: 89 additions & 15 deletions 104 configure
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

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

Loading
Oops, something went wrong.

Uh oh!

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

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.