Skip to content

Commit 9b69a55

Browse files
authored
gh-141172: Update to wasi-sdk-29 (GH-141684)
This commit updates CI and configuration from wasi-sdk-25 to wasi-sdk-29 which was released recently. This notably includes stubs for pthreads which all return errors, so some adjustment in logic is necessary to retain knowledge that WASI cannot yet spawn threads for example. This additionally increases the wasm stack allowance to 32MiB from 16MiB to accomodate the `test_recursive_pickle` test in the `test_functools.py` file. It looks like the Clang/LLVM update that happened in wasi-sdk-29 relative to wasi-sdk-25 is likely the cause of this where presumably functions have more locals than before and/or a slightly adjusted stack space requirement which overflows the stack.
1 parent 4bcab46 commit 9b69a55

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.github/workflows/reusable-wasi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 60
1414
env:
1515
WASMTIME_VERSION: 38.0.3
16-
WASI_SDK_VERSION: 25
16+
WASI_SDK_VERSION: 29
1717
WASI_SDK_PATH: /opt/wasi-sdk
1818
CROSS_BUILD_PYTHON: cross-build/build
1919
CROSS_BUILD_WASI: cross-build/wasm32-wasip1

Include/pyport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ extern "C" {
504504
* Thread support is stubbed and any attempt to create a new thread fails.
505505
*/
506506
#if (!defined(HAVE_PTHREAD_STUBS) && \
507+
!defined(__wasi__) && \
507508
(!defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__)))
508509
# define Py_CAN_START_THREADS 1
509510
#endif

Lib/test/test_sys.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,12 @@ def test_thread_info(self):
730730
self.assertEqual(len(info), 3)
731731
self.assertIn(info.name, ('nt', 'pthread', 'pthread-stubs', 'solaris', None))
732732
self.assertIn(info.lock, ('pymutex', None))
733-
if sys.platform.startswith(("linux", "android", "freebsd")):
733+
if sys.platform.startswith(("linux", "android", "freebsd", "wasi")):
734734
self.assertEqual(info.name, "pthread")
735735
elif sys.platform == "win32":
736736
self.assertEqual(info.name, "nt")
737737
elif sys.platform == "emscripten":
738738
self.assertIn(info.name, {"pthread", "pthread-stubs"})
739-
elif sys.platform == "wasi":
740-
self.assertEqual(info.name, "pthread-stubs")
741739

742740
def test_abi_info(self):
743741
info = sys.abi_info
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update to WASI SDK 29.

Tools/wasm/wasi/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
b"# Required to statically build extension modules."
3232
)
3333

34-
WASI_SDK_VERSION = 25
34+
WASI_SDK_VERSION = 29
3535

3636
WASMTIME_VAR_NAME = "WASMTIME"
3737
WASMTIME_HOST_RUNNER_VAR = f"{{{WASMTIME_VAR_NAME}}}"
@@ -419,8 +419,8 @@ def main():
419419
f"{WASMTIME_HOST_RUNNER_VAR} run "
420420
# Make sure the stack size will work for a pydebug
421421
# build.
422-
# Use 16 MiB stack.
423-
"--wasm max-wasm-stack=16777216 "
422+
# Use 32 MiB stack.
423+
"--wasm max-wasm-stack=33554432 "
424424
# Enable thread support; causes use of preview1.
425425
# "--wasm threads=y --wasi threads=y "
426426
# Map the checkout to / to load the stdlib from /Lib.

0 commit comments

Comments
 (0)