From fed9204d52e36756301aa72874ebe8753a935432 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 24 Jan 2022 21:28:12 +0100 Subject: [PATCH] bpo-40280: Get help() working and more - include urllib.parse for pydoc - skip modules that require shared mod and dlopen - fix WASI block in configure Signed-off-by: Christian Heimes --- Tools/wasm/wasm_assets.py | 6 +++++- configure | 16 +++++++++------- configure.ac | 11 ++++++----- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py index 6a4027184030f7..bb1983af4c7a70 100755 --- a/Tools/wasm/wasm_assets.py +++ b/Tools/wasm/wasm_assets.py @@ -71,7 +71,11 @@ "smtplib.py", "socketserver.py", "telnetlib.py", - "urllib/", + # keep urllib.parse for pydoc + "urllib/error.py", + "urllib/request.py", + "urllib/response.py", + "urllib/robotparser.py", "wsgiref/", "xmlrpc/", # dbm / gdbm diff --git a/configure b/configure index f40d425371dc6d..78e5a099272218 100755 --- a/configure +++ b/configure @@ -7684,7 +7684,7 @@ case $ac_sys_system/$ac_sys_emscripten_target in #( LDFLAGS_NODIST="$LDFLAGS_NODIST -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s NODERAWFS=1 -s EXIT_RUNTIME=1 -s USE_PTHREADS -s PROXY_TO_PTHREAD" CFLAGS_NODIST="$CFLAGS_NODIST -pthread" ;; #( - WASI) : + WASI/*) : $as_echo "#define _WASI_EMULATED_SIGNAL 1" >>confdefs.h @@ -21345,6 +21345,8 @@ $as_echo_n "checking for additional Modules/Setup files... " >&6; } case $ac_sys_system in #( Emscripten) : MODULES_SETUP_STDLIB=Modules/Setup.stdlib ;; #( + WASI) : + MODULES_SETUP_STDLIB=Modules/Setup.stdlib ;; #( *) : MODULES_SETUP_STDLIB= ;; @@ -23421,7 +23423,7 @@ $as_echo_n "checking for stdlib extension module _testimportmultiple... " >&6; } py_cv_module__testimportmultiple=n/a ;; #( *) : if test "$TEST_MODULES" = yes; then : - if true; then : + if test "$ac_cv_func_dlopen" = yes; then : py_cv_module__testimportmultiple=yes else py_cv_module__testimportmultiple=missing @@ -23457,7 +23459,7 @@ $as_echo_n "checking for stdlib extension module _testmultiphase... " >&6; } py_cv_module__testmultiphase=n/a ;; #( *) : if test "$TEST_MODULES" = yes; then : - if true; then : + if test "$ac_cv_func_dlopen" = yes; then : py_cv_module__testmultiphase=yes else py_cv_module__testmultiphase=missing @@ -23565,8 +23567,8 @@ $as_echo_n "checking for stdlib extension module xxlimited... " >&6; } *xxlimited*) : py_cv_module_xxlimited=n/a ;; #( *) : - if test "$with_trace_refs" = "no" -a "$ac_sys_system" != "Emscripten"; then : - if true; then : + if test "$with_trace_refs" = "no"; then : + if test "$ac_cv_func_dlopen" = yes; then : py_cv_module_xxlimited=yes else py_cv_module_xxlimited=missing @@ -23601,8 +23603,8 @@ $as_echo_n "checking for stdlib extension module xxlimited_35... " >&6; } *xxlimited_35*) : py_cv_module_xxlimited_35=n/a ;; #( *) : - if test "$with_trace_refs" = "no" -a "$ac_sys_system" != "Emscripten"; then : - if true; then : + if test "$with_trace_refs" = "no"; then : + if test "$ac_cv_func_dlopen" = yes; then : py_cv_module_xxlimited_35=yes else py_cv_module_xxlimited_35=missing diff --git a/configure.ac b/configure.ac index 8d140427de48da..a0fbe41c9ec59c 100644 --- a/configure.ac +++ b/configure.ac @@ -1850,7 +1850,7 @@ AS_CASE([$ac_sys_system/$ac_sys_emscripten_target], LDFLAGS_NODIST="$LDFLAGS_NODIST -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s NODERAWFS=1 -s EXIT_RUNTIME=1 -s USE_PTHREADS -s PROXY_TO_PTHREAD" CFLAGS_NODIST="$CFLAGS_NODIST -pthread" ], - [WASI], [ + [WASI/*], [ AC_DEFINE([_WASI_EMULATED_SIGNAL], [1], [Define to 1 if you want to emulate signals on WASI]) LIBS="$LIBS -lwasi-emulated-signal" echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h @@ -6407,6 +6407,7 @@ dnl Use Modules/Setup.stdlib as additional provider? AC_MSG_CHECKING([for additional Modules/Setup files]) AS_CASE([$ac_sys_system], [Emscripten], [MODULES_SETUP_STDLIB=Modules/Setup.stdlib], + [WASI], [MODULES_SETUP_STDLIB=Modules/Setup.stdlib], [MODULES_SETUP_STDLIB=] ) AC_MSG_RESULT([$MODULES_SETUP_STDLIB]) @@ -6599,16 +6600,16 @@ dnl test modules PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes]) -PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes]) -PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes]) +PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_ctypes_test], [test "$TEST_MODULES" = yes], [], [], [-lm]) dnl Limited API template modules. dnl The limited C API is not compatible with the Py_TRACE_REFS macro. dnl Emscripten does not support shared libraries yet. -PY_STDLIB_MOD([xxlimited], [test "$with_trace_refs" = "no" -a "$ac_sys_system" != "Emscripten"]) -PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no" -a "$ac_sys_system" != "Emscripten"]) +PY_STDLIB_MOD([xxlimited], [test "$with_trace_refs" = "no"], [test "$ac_cv_func_dlopen" = yes]) +PY_STDLIB_MOD([xxlimited_35], [test "$with_trace_refs" = "no"], [test "$ac_cv_func_dlopen" = yes]) # substitute multiline block, must come after last PY_STDLIB_MOD() AC_SUBST([MODULE_BLOCK])