mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (#116327)
* GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives * Add the configure changes * Update `wasm_build.py`
This commit is contained in:
parent
6cddc731fb
commit
7af063d1d8
6 changed files with 12 additions and 7 deletions
|
@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
|
||||||
ENV WASI_SDK_PATH=/opt/wasi-sdk
|
ENV WASI_SDK_PATH=/opt/wasi-sdk
|
||||||
|
|
||||||
ENV WASMTIME_HOME=/opt/wasmtime
|
ENV WASMTIME_HOME=/opt/wasmtime
|
||||||
ENV WASMTIME_VERSION=14.0.4
|
ENV WASMTIME_VERSION=18.0.2
|
||||||
ENV WASMTIME_CPU_ARCH=x86_64
|
ENV WASMTIME_CPU_ARCH=x86_64
|
||||||
|
|
||||||
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
|
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
|
|
@ -283,8 +283,10 @@ def main():
|
||||||
# The 8388608 value comes from `ulimit -s` under Linux
|
# The 8388608 value comes from `ulimit -s` under Linux
|
||||||
# which equates to 8291 KiB.
|
# which equates to 8291 KiB.
|
||||||
"--wasm max-wasm-stack=8388608 "
|
"--wasm max-wasm-stack=8388608 "
|
||||||
# Enable thread support.
|
# Use WASI 0.2 primitives.
|
||||||
"--wasm threads=y --wasi threads=y "
|
"--wasi preview2 "
|
||||||
|
# Enable thread support; causes use of preview1.
|
||||||
|
#"--wasm threads=y --wasi threads=y "
|
||||||
# Map the checkout to / to load the stdlib from /Lib.
|
# Map the checkout to / to load the stdlib from /Lib.
|
||||||
"--dir {HOST_DIR}::{GUEST_DIR} "
|
"--dir {HOST_DIR}::{GUEST_DIR} "
|
||||||
# Set PYTHONPATH to the sysconfig data.
|
# Set PYTHONPATH to the sysconfig data.
|
||||||
|
|
|
@ -329,8 +329,10 @@ 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 "
|
||||||
|
"--wasi preview2 "
|
||||||
|
"--dir {srcdir}::/ "
|
||||||
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
|
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
|
||||||
"--mapdir /::{srcdir} --"
|
|
||||||
),
|
),
|
||||||
"PATH": [WASI_SDK_PATH / "bin", os.environ["PATH"]],
|
"PATH": [WASI_SDK_PATH / "bin", os.environ["PATH"]],
|
||||||
},
|
},
|
||||||
|
|
2
configure
generated
vendored
2
configure
generated
vendored
|
@ -7655,7 +7655,7 @@ then :
|
||||||
fi
|
fi
|
||||||
;; #(
|
;; #(
|
||||||
WASI/*) :
|
WASI/*) :
|
||||||
HOSTRUNNER='wasmtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --mapdir /::$(srcdir) --' ;; #(
|
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=''
|
HOSTRUNNER=''
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1537,7 +1537,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 --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell cat pybuilddir.txt):/Lib --mapdir /::$(srcdir) --'],
|
[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='']
|
[HOSTRUNNER='']
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue