GH-142234: Allow --enable-wasm-dynamic-linking under WASI (GH-142235)
Some checks are pending
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Ubuntu SSL tests with AWS-LC (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / iOS (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
mypy / Run mypy on Lib/_pyrepl (push) Waiting to run
mypy / Run mypy on Lib/test/libregrtest (push) Waiting to run
mypy / Run mypy on Lib/tomllib (push) Waiting to run
mypy / Run mypy on Tools/build (push) Waiting to run
mypy / Run mypy on Tools/cases_generator (push) Waiting to run
mypy / Run mypy on Tools/clinic (push) Waiting to run
mypy / Run mypy on Tools/jit (push) Waiting to run
mypy / Run mypy on Tools/peg_generator (push) Waiting to run

While CPython doesn't support `--enable-wasm-dynamic-linking`, external tools like componentize-py do and they have to patch around it. Since the flag is off by default, allowing the flag so external users can add/inject dynamic linking support seems acceptable.
This commit is contained in:
Brett Cannon 2025-12-05 15:27:16 -08:00 committed by GitHub
parent d49e6f38a7
commit eba449a198
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,3 @@
Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't
directly support it so external/downstream users do not have to patch in
support for the flag.

5
configure generated vendored
View file

@ -1824,7 +1824,8 @@ Optional Features:
no)
--enable-wasm-dynamic-linking
Enable dynamic linking support for WebAssembly
(default is no)
(default is no); WASI requires an external dynamic
loader to handle imports
--enable-wasm-pthreads Enable pthread emulation for WebAssembly (default is
no)
--enable-shared enable building a shared Python library (default is
@ -7415,7 +7416,7 @@ then :
Emscripten) :
;; #(
WASI) :
as_fn_error $? "WASI dynamic linking is not implemented yet." "$LINENO" 5 ;; #(
;; #(
*) :
as_fn_error $? "--enable-wasm-dynamic-linking only applies to Emscripten and WASI" "$LINENO" 5
;;

View file

@ -1323,11 +1323,11 @@ dnl See https://emscripten.org/docs/compiling/Dynamic-Linking.html
AC_MSG_CHECKING([for --enable-wasm-dynamic-linking])
AC_ARG_ENABLE([wasm-dynamic-linking],
[AS_HELP_STRING([--enable-wasm-dynamic-linking],
[Enable dynamic linking support for WebAssembly (default is no)])],
[Enable dynamic linking support for WebAssembly (default is no); WASI requires an external dynamic loader to handle imports])],
[
AS_CASE([$ac_sys_system],
[Emscripten], [],
[WASI], [AC_MSG_ERROR([WASI dynamic linking is not implemented yet.])],
[WASI], [],
[AC_MSG_ERROR([--enable-wasm-dynamic-linking only applies to Emscripten and WASI])]
)
], [