Skip to content

Commit

Permalink
GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/previ…
Browse files Browse the repository at this point in the history
…ew2 primitives
  • Loading branch information
brettcannon committed Mar 4, 2024
1 parent eb22e2b commit b4a23d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
ENV WASI_SDK_PATH=/opt/wasi-sdk

ENV WASMTIME_HOME=/opt/wasmtime
ENV WASMTIME_VERSION=14.0.4
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)' && \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
6 changes: 4 additions & 2 deletions Tools/wasm/wasi.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ def main():
# The 8388608 value comes from `ulimit -s` under Linux
# which equates to 8291 KiB.
"--wasm max-wasm-stack=8388608 "
# Enable thread support.
"--wasm threads=y --wasi threads=y "
# Use WASI 0.2 primitives.
"--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.
"--dir {HOST_DIR}::{GUEST_DIR} "
# Set PYTHONPATH to the sysconfig data.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,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
Expand Down

0 comments on commit b4a23d2

Please sign in to comment.