Skip to content

Commit

Permalink
Increase wasm limit to 32kb
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Jun 5, 2024
1 parent 0242212 commit 12f8c0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Tools/wasm/wasi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Tools/wasm/wasm_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12f8c0e

Please sign in to comment.