Disable building test modules that require dlopen() under WASI SDK 21 #115983
Copy link
Copy link
Closed
Labels
Description
Activity
- addedbuildThe build process and cross-buildThe build process and cross-build
on Feb 27, 2024 Might be easiest to set
--disable-test-modules, otherwise for the other modules we need to statically compile the modules.Might be easiest to set
--disable-test-modules, otherwise for the other modules we need to statically compile the modules.Related:
Maybe add a test for WASI?
diff --git a/configure.ac b/configure.ac index e615259dcb..6a5b5839e8 100644 --- a/configure.ac +++ b/configure.ac @@ -7626,9 +7626,9 @@ PY_STDLIB_MOD([_testclinic_limited], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testlimitedcapi], [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], [test "$ac_cv_func_dlopen" = yes]) -PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) -PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes]) +PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes -a "$ac_sys_system" != "WASI"]) +PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes -a "$ac_sys_system" != "WASI"]) +PY_STDLIB_MOD([_testsinglephase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes -a "$ac_sys_system" != "WASI"]) PY_STDLIB_MOD([_testexternalinspection], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([xxsubtype], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes]) @@ -7638,8 +7638,8 @@ PY_STDLIB_MOD([_ctypes_test], dnl Limited API template modules. dnl Emscripten does not support shared libraries yet. -PY_STDLIB_MOD([xxlimited], [], [test "$ac_cv_func_dlopen" = yes]) -PY_STDLIB_MOD([xxlimited_35], [], [test "$ac_cv_func_dlopen" = yes]) +PY_STDLIB_MOD([xxlimited], [], [test "$ac_cv_func_dlopen" = yes -a "$ac_sys_system" != "WASI"]) +PY_STDLIB_MOD([xxlimited_35], [], [test "$ac_cv_func_dlopen" = yes -a "$ac_sys_system" != "WASI"]) # substitute multiline block, must come after last PY_STDLIB_MOD() AC_SUBST([MODULE_BLOCK])
The modules we should probably skip building under WASI as they must be built as shared modules:
cpython/Modules/Setup.stdlib.in
Lines 170 to 180 in c951e25
# Some testing modules MUST be built as shared libraries. *shared* @MODULE__TESTIMPORTMULTIPLE_TRUE@_testimportmultiple _testimportmultiple.c @MODULE__TESTMULTIPHASE_TRUE@_testmultiphase _testmultiphase.c @MODULE__TESTSINGLEPHASE_TRUE@_testsinglephase _testsinglephase.c @MODULE__TESTEXTERNALINSPECTION_TRUE@_testexternalinspection _testexternalinspection.c @MODULE__CTYPES_TEST_TRUE@_ctypes_test _ctypes/_ctypes_test.c # Limited API template modules; must be built as shared modules. @MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c @MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c - added a commit that references this issue
on Jun 10, 2024
_testimportmultiple,_testmultiphase,_testsinglephase,xxlimited,xxlimited_35all get built under WASI SDK 21 thanks todlopen(), but since that function doesn't work normally under WASI we should skip building them.cpython/configure.ac
Lines 7582 to 7593 in 6087315
We could either update
Tools/wasm/wasi.pyto disable test modules, updateconfigure.acso they don't get compiled under WASI, or see if we can get them compiled in statically.Linked PRs