Skip to content

Commit 85b5db7

Browse files
committed
pythongh-90473: Increase stack size, disable obmalloc on WASI
1 parent 079f0dd commit 85b5db7

File tree

5 files changed

+43
-10
lines changed

5 files changed

+43
-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

+16-4
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,9 @@ 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
1999+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=262144 -Wl,--initial-memory=10485760"])
19972000
]
19982001
)
19992002

@@ -4046,13 +4049,17 @@ dnl the check does not work on cross compilation case...
40464049
#include <sys/types.h>
40474050
#include <sys/socket.h>]],
40484051
[[int domain = AF_INET6;]])],[
4049-
AC_MSG_RESULT(yes)
40504052
ipv6=yes
40514053
],[
4052-
AC_MSG_RESULT(no)
40534054
ipv6=no
40544055
])
40554056
4057+
AS_CASE([$ac_sys_system],
4058+
[WASI], [ipv6=no]
4059+
)
4060+
4061+
AC_MSG_RESULT([$ipv6])
4062+
40564063
if test "$ipv6" = "yes"; then
40574064
AC_MSG_CHECKING(if RFC2553 API is available)
40584065
AC_COMPILE_IFELSE([
@@ -4232,9 +4239,10 @@ AC_ARG_WITH(pymalloc,
42324239

42334240
if test -z "$with_pymalloc"
42344241
then
4235-
dnl default to yes except for wasm32-emscripten
4242+
dnl default to yes except for wasm32-emscripten and wasm32-wasi.
42364243
AS_CASE([$ac_sys_system],
42374244
[Emscripten], [with_pymalloc="no"],
4245+
[WASI], [with_pymalloc="no"],
42384246
[with_pymalloc="yes"]
42394247
)
42404248
fi
@@ -6680,7 +6688,11 @@ AS_CASE([$ac_sys_system],
66806688
)
66816689
],
66826690
[Emscripten/node*], [],
6683-
[WASI/*], []
6691+
[WASI/*], [
6692+
PY_STDLIB_MOD_SET_NA(
6693+
[_ctypes_test],
6694+
)
6695+
]
66846696
)
66856697
],
66866698
[PY_STDLIB_MOD_SET_NA([_scproxy])]

0 commit comments

Comments
 (0)