[3.12] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (GH-116327) (GH-116373)

This commit is contained in:
Brett Cannon 2024-03-05 13:35:02 -08:00 committed by GitHub
parent 23a9ba45ae
commit 88fdb082d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 6 deletions

View file

@ -2,11 +2,11 @@ FROM docker.io/library/fedora:37
ENV CC=clang
ENV WASI_SDK_VERSION=19
ENV WASI_SDK_VERSION=20
ENV WASI_SDK_PATH=/opt/wasi-sdk
ENV WASMTIME_HOME=/opt/wasmtime
ENV WASMTIME_VERSION=7.0.0
ENV WASMTIME_VERSION=18.0.2
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)' && \

View file

@ -0,0 +1 @@
Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.

View file

@ -316,8 +316,10 @@ def _check_wasi():
# workaround for https://github.com/python/cpython/issues/95952
"HOSTRUNNER": (
"wasmtime run "
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib "
"--mapdir /::{srcdir} --"
"--wasm max-wasm-stack=8388608 "
"--wasi preview2 "
"--dir {srcdir}::/ "
"--env PYTHONPATH=/{relbuilddir}/build/lib.wasi-wasm32-{version}:/Lib"
),
"PATH": [WASI_SDK_PATH / "bin", os.environ["PATH"]],
},

2
configure generated vendored
View file

@ -7720,7 +7720,7 @@ then :
fi
;; #(
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=''
;;

View file

@ -1601,7 +1601,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 --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='']
)
fi