diff --git a/Tools/wasm/wasi.py b/Tools/wasm/wasi.py index a6c63887dc9111..a8f7d4f0683bbd 100644 --- a/Tools/wasm/wasi.py +++ b/Tools/wasm/wasi.py @@ -280,9 +280,9 @@ def main(): default_host_runner = (f"{shutil.which('wasmtime')} run " # Make sure the stack size will work for a pydebug # build. - # The 8388608 value comes from double of `ulimit -s` under Linux - # which equates to 8291*2 KiB. - "--wasm max-wasm-stack=16777216 " + # The 33554432 value comes from quadruple of `ulimit -s` under Linux + # which equates to 8291*4 KiB. + "--wasm max-wasm-stack=33554432 " # Use WASI 0.2 primitives. "--wasi preview2 " # Enable thread support; causes use of preview1. diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py index bcb80212362b71..95e4d91211e431 100755 --- a/Tools/wasm/wasm_build.py +++ b/Tools/wasm/wasm_build.py @@ -329,7 +329,7 @@ def _check_wasi() -> None: # workaround for https://github.com/python/cpython/issues/95952 "HOSTRUNNER": ( "wasmtime run " - "--wasm max-wasm-stack=16777216 " + "--wasm max-wasm-stack=33554432 " "--wasi preview2 " "--dir {srcdir}::/ " "--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib" diff --git a/configure b/configure index 95a3c34fa2bc65..32ce47e53d19f1 100755 --- a/configure +++ b/configure @@ -7758,7 +7758,7 @@ then : fi ;; #( WASI/*) : - HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #( + HOSTRUNNER='wasmtime run --wasm max-wasm-stack=33554432 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #( *) : HOSTRUNNER='' ;; diff --git a/configure.ac b/configure.ac index d5d614dab07406..c652583d9a2d6e 100644 --- a/configure.ac +++ b/configure.ac @@ -1609,7 +1609,7 @@ then dnl TODO: support other WASI runtimes dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the dnl directory containing _sysconfigdata to PYTHONPATH. - [WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=16777216 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'], + [WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=33554432 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'], [HOSTRUNNER=''] ) fi