% (TESTFN_UNENCODABLE, sys.getfilesystemencoding()))
TESTFN_UNENCODABLE = None
# macOS and Emscripten deny unencodable filenames (invalid utf-8)
-elif sys.platform not in {'darwin', 'emscripten'}:
+elif sys.platform not in {'darwin', 'emscripten', 'wasi'}:
try:
# ascii and utf-8 cannot encode the byte 0xff
b'\xff'.decode(sys.getfilesystemencoding())
msg=f"source={source} mode={mode}")
- @unittest.skipIf(support.is_emscripten, "socket.accept is broken")
+ @unittest.skipIf(
+ support.is_emscripten or support.is_wasi,
+ "socket.accept is broken"
+ )
def test_compile_top_level_await(self):
"""Test whether code some top level await can be compiled.
--- /dev/null
+Disable pymalloc and increase stack size on ``wasm32-wasi``.
LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h
+ as_fn_append LDFLAGS_NODIST " -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760"
+
;; #(
*) :
;;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
ipv6=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
ipv6=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+case $ac_sys_system in #(
+ WASI) :
+ ipv6=no
+ ;; #(
+ *) :
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6" >&5
+$as_echo "$ipv6" >&6; }
+
if test "$ipv6" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5
$as_echo_n "checking if RFC2553 API is available... " >&6; }
case $ac_sys_system in #(
Emscripten) :
with_pymalloc="no" ;; #(
+ WASI) :
+ with_pymalloc="no" ;; #(
*) :
with_pymalloc="yes"
;;
;; #(
WASI/*) :
+
+
+ py_cv_module__ctypes_test=n/a
+ py_cv_module_=n/a
+
+
;; #(
*) :
;;
AC_DEFINE([_WASI_EMULATED_PROCESS_CLOCKS], [1], [Define to 1 if you want to emulate process clocks on WASI])
LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h
+
+ dnl increase initial memory and stack size, move stack first
+ dnl https://github.com/WebAssembly/wasi-libc/issues/233
+ AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760"])
]
)
#include <sys/types.h>
#include <sys/socket.h>]],
[[int domain = AF_INET6;]])],[
- AC_MSG_RESULT(yes)
ipv6=yes
],[
- AC_MSG_RESULT(no)
ipv6=no
])
+AS_CASE([$ac_sys_system],
+ [WASI], [ipv6=no]
+)
+
+AC_MSG_RESULT([$ipv6])
+
if test "$ipv6" = "yes"; then
AC_MSG_CHECKING(if RFC2553 API is available)
AC_COMPILE_IFELSE([
if test -z "$with_pymalloc"
then
- dnl default to yes except for wasm32-emscripten
+ dnl default to yes except for wasm32-emscripten and wasm32-wasi.
AS_CASE([$ac_sys_system],
[Emscripten], [with_pymalloc="no"],
+ [WASI], [with_pymalloc="no"],
[with_pymalloc="yes"]
)
fi
)
],
[Emscripten/node*], [],
- [WASI/*], []
+ [WASI/*], [
+ PY_STDLIB_MOD_SET_NA(
+ [_ctypes_test],
+ )
+ ]
)
],
[PY_STDLIB_MOD_SET_NA([_scproxy])]