Add wazero to the list of tested wasm runtimes

This commit is contained in:
Frank Denis 2022-12-17 21:46:00 +01:00
parent 1ff1396283
commit 51f6b2df8d

View File

@ -9,9 +9,20 @@ if command -v wasm-opt >/dev/null; then
wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1"
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then
if command -v wavm >/dev/null; then
wavm run --abi=wasi "$1" && exit 0
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then
if command -v wasmedgec >/dev/null && command -v wasmedge >/dev/null; then
wasmedgec "$1" "${1}.so" &&
wasmedge --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" "--${WASMER_BACKEND:-cranelift}" --dir=. && exit 0
fi
fi
@ -21,30 +32,9 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then
if command -v wasmer >/dev/null; then
wasmer run "$1" "--${WASMER_BACKEND:-cranelift}" --dir=. && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then
if command -v wasm3 >/dev/null; then
wasm3 "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then
if iwasm | grep -qi wasi >/dev/null 2>&1; then
iwasm "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then
if command -v wasmedgec >/dev/null && command -v wasmedge >/dev/null; then
wasmedgec "$1" "${1}.so" &&
wasmedge --dir=.:. "${1}.so" &&
rm -f "${1}.so" &&
exit 0
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then
if command -v wavm >/dev/null; then
wavm run --abi=wasi "$1" && exit 0
fi
fi
@ -64,6 +54,24 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "node" ]; then
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then
if command -v wasm3 >/dev/null; then
wasm3 "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then
if iwasm | grep -qi wasi >/dev/null 2>&1; then
iwasm "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wazero" ]; then
if command -v wazero >/dev/null; then
wazero run -mount .:/ "$1" && exit 0
fi
fi
if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer-js" ]; then
if command -v wasmer-js >/dev/null; then
wasmer-js run "$1" --dir=. && exit 0