Browse Source

Clarify that --min-reserved-size surprisingly sets the max memory

coverity_scan
Frank Denis 5 years ago
parent
commit
3fde7349e1
  1. 16
      test/default/wasi-test-wrapper.sh

16
test/default/wasi-test-wrapper.sh

@ -1,26 +1,28 @@
#! /bin/sh
MAX_MEMORY_MB="128"
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then
if command -v wasmtime >/dev/null; then
wasmtime -o --dir=. "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then
if command -v wasmer >/dev/null; then
wasmer run "$1" --backend "${WASMER_BACKEND:-cranelift}" --dir=. && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "lucet" ]; then
if command -v lucetc-wasi >/dev/null && command -v lucet-wasi >/dev/null; then
lucetc-wasi \
--min-reserved-size "128MiB" \
--min-reserved-size "${MAX_MEMORY_MB}MiB" \
-o "${1}.so" --opt-level best "$1" &&
lucet-wasi --dir=.:. "${1}.so" &&
rm -f "${1}.so" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then
if command -v wasmer >/dev/null; then
wasmer run "$1" --backend "${WASMER_BACKEND:-cranelift}" --dir=. && exit 0
fi
fi
echo "WebAssembly runtime failed" >&2
exit 1

Loading…
Cancel
Save