mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-120507: Double WASI memory (#120648)
Use 16 MiB stack with 40 MiB memory limit, instead of 8 MiB stack with 20 MiB memory limit.
This commit is contained in:
parent
0506f75c53
commit
6acf7776ef
4 changed files with 8 additions and 9 deletions
|
@ -280,9 +280,8 @@ def main():
|
||||||
default_host_runner = (f"{shutil.which('wasmtime')} run "
|
default_host_runner = (f"{shutil.which('wasmtime')} run "
|
||||||
# Make sure the stack size will work for a pydebug
|
# Make sure the stack size will work for a pydebug
|
||||||
# build.
|
# build.
|
||||||
# The 8388608 value comes from `ulimit -s` under Linux
|
# Use 16 MiB stack.
|
||||||
# which equates to 8291 KiB.
|
"--wasm max-wasm-stack=16777216 "
|
||||||
"--wasm max-wasm-stack=8388608 "
|
|
||||||
# Use WASI 0.2 primitives.
|
# Use WASI 0.2 primitives.
|
||||||
"--wasi preview2 "
|
"--wasi preview2 "
|
||||||
# Enable thread support; causes use of preview1.
|
# Enable thread support; causes use of preview1.
|
||||||
|
|
|
@ -329,7 +329,7 @@ WASI = Platform(
|
||||||
# workaround for https://github.com/python/cpython/issues/95952
|
# workaround for https://github.com/python/cpython/issues/95952
|
||||||
"HOSTRUNNER": (
|
"HOSTRUNNER": (
|
||||||
"wasmtime run "
|
"wasmtime run "
|
||||||
"--wasm max-wasm-stack=8388608 "
|
"--wasm max-wasm-stack=16777216 "
|
||||||
"--wasi preview2 "
|
"--wasi preview2 "
|
||||||
"--dir {srcdir}::/ "
|
"--dir {srcdir}::/ "
|
||||||
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
|
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
|
||||||
|
|
4
configure
generated
vendored
4
configure
generated
vendored
|
@ -7758,7 +7758,7 @@ then :
|
||||||
fi
|
fi
|
||||||
;; #(
|
;; #(
|
||||||
WASI/*) :
|
WASI/*) :
|
||||||
HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --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=16777216 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/' ;; #(
|
||||||
*) :
|
*) :
|
||||||
HOSTRUNNER=''
|
HOSTRUNNER=''
|
||||||
;;
|
;;
|
||||||
|
@ -9560,7 +9560,7 @@ then :
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
as_fn_append LDFLAGS_NODIST " -z stack-size=8388608 -Wl,--stack-first -Wl,--initial-memory=20971520"
|
as_fn_append LDFLAGS_NODIST " -z stack-size=16777216 -Wl,--stack-first -Wl,--initial-memory=41943040"
|
||||||
|
|
||||||
;; #(
|
;; #(
|
||||||
*) :
|
*) :
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ then
|
||||||
dnl TODO: support other WASI runtimes
|
dnl TODO: support other WASI runtimes
|
||||||
dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
|
dnl wasmtime starts the proces with "/" as CWD. For OOT builds add the
|
||||||
dnl directory containing _sysconfigdata to PYTHONPATH.
|
dnl directory containing _sysconfigdata to PYTHONPATH.
|
||||||
[WASI/*], [HOSTRUNNER='wasmtime run --wasm max-wasm-stack=8388608 --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=16777216 --wasi preview2 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --dir $(srcdir)::/'],
|
||||||
[HOSTRUNNER='']
|
[HOSTRUNNER='']
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
@ -2403,10 +2403,10 @@ AS_CASE([$ac_sys_system],
|
||||||
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
|
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl gh-117645: Set the memory size to 20 MiB, the stack size to 8 MiB,
|
dnl gh-117645: Set the memory size to 40 MiB, the stack size to 16 MiB,
|
||||||
dnl and move the stack first.
|
dnl and move the stack first.
|
||||||
dnl https://github.com/WebAssembly/wasi-libc/issues/233
|
dnl https://github.com/WebAssembly/wasi-libc/issues/233
|
||||||
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=8388608 -Wl,--stack-first -Wl,--initial-memory=20971520"])
|
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=16777216 -Wl,--stack-first -Wl,--initial-memory=41943040"])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue