Skip to content

Commit d81d57e

Browse files
authored
gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)
1 parent e371d5d commit d81d57e

File tree

5 files changed

+44
-10
lines changed

5 files changed

+44
-10
lines changed

Lib/test/support/os_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
% (TESTFN_UNENCODABLE, sys.getfilesystemencoding()))
5151
TESTFN_UNENCODABLE = None
5252
# macOS and Emscripten deny unencodable filenames (invalid utf-8)
53-
elif sys.platform not in {'darwin', 'emscripten'}:
53+
elif sys.platform not in {'darwin', 'emscripten', 'wasi'}:
5454
try:
5555
# ascii and utf-8 cannot encode the byte 0xff
5656
b'\xff'.decode(sys.getfilesystemencoding())

Lib/test/test_builtin.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ def test_compile_top_level_await_no_coro(self):
393393
msg=f"source={source} mode={mode}")
394394

395395

396-
@unittest.skipIf(support.is_emscripten, "socket.accept is broken")
396+
@unittest.skipIf(
397+
support.is_emscripten or support.is_wasi,
398+
"socket.accept is broken"
399+
)
397400
def test_compile_top_level_await(self):
398401
"""Test whether code some top level await can be compiled.
399402
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Disable pymalloc and increase stack size on ``wasm32-wasi``.

configure

+21-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+17-4
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,10 @@ AS_CASE([$ac_sys_system],
19941994
AC_DEFINE([_WASI_EMULATED_PROCESS_CLOCKS], [1], [Define to 1 if you want to emulate process clocks on WASI])
19951995
LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
19961996
echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h
1997+
1998+
dnl increase initial memory and stack size, move stack first
1999+
dnl https://github.com/WebAssembly/wasi-libc/issues/233
2000+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760"])
19972001
]
19982002
)
19992003

@@ -4046,13 +4050,17 @@ dnl the check does not work on cross compilation case...
40464050
#include <sys/types.h>
40474051
#include <sys/socket.h>]],
40484052
[[int domain = AF_INET6;]])],[
4049-
AC_MSG_RESULT(yes)
40504053
ipv6=yes
40514054
],[
4052-
AC_MSG_RESULT(no)
40534055
ipv6=no
40544056
])
40554057
4058+
AS_CASE([$ac_sys_system],
4059+
[WASI], [ipv6=no]
4060+
)
4061+
4062+
AC_MSG_RESULT([$ipv6])
4063+
40564064
if test "$ipv6" = "yes"; then
40574065
AC_MSG_CHECKING(if RFC2553 API is available)
40584066
AC_COMPILE_IFELSE([
@@ -4232,9 +4240,10 @@ AC_ARG_WITH(pymalloc,
42324240

42334241
if test -z "$with_pymalloc"
42344242
then
4235-
dnl default to yes except for wasm32-emscripten
4243+
dnl default to yes except for wasm32-emscripten and wasm32-wasi.
42364244
AS_CASE([$ac_sys_system],
42374245
[Emscripten], [with_pymalloc="no"],
4246+
[WASI], [with_pymalloc="no"],
42384247
[with_pymalloc="yes"]
42394248
)
42404249
fi
@@ -6680,7 +6689,11 @@ AS_CASE([$ac_sys_system],
66806689
)
66816690
],
66826691
[Emscripten/node*], [],
6683-
[WASI/*], []
6692+
[WASI/*], [
6693+
PY_STDLIB_MOD_SET_NA(
6694+
[_ctypes_test],
6695+
)
6696+
]
66846697
)
66856698
],
66866699
[PY_STDLIB_MOD_SET_NA([_scproxy])]

0 commit comments

Comments
 (0)