2023-03-25 09:48:03 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright 2023 The Go Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
2023-04-17 23:13:52 -06:00
|
|
|
case "$GOWASIRUNTIME" in
|
2023-05-09 21:32:19 -06:00
|
|
|
"wasmedge")
|
|
|
|
exec wasmedge --dir=/ --env PWD="$PWD" "$1" "${@:2}"
|
|
|
|
;;
|
2023-05-08 23:21:19 -06:00
|
|
|
"wasmer")
|
|
|
|
exec wasmer run --dir=/ --env PWD="$PWD" "$1" -- "${@:2}"
|
|
|
|
;;
|
2023-04-17 23:13:52 -06:00
|
|
|
"wasmtime")
|
|
|
|
exec wasmtime run --dir=/ --env PWD="$PWD" --max-wasm-stack 1048576 "$1" -- "${@:2}"
|
|
|
|
;;
|
|
|
|
"wazero" | "")
|
2023-04-26 13:54:28 -06:00
|
|
|
exec wazero run -mount /:/ -env-inherit -cachedir "${TMPDIR:-/tmp}"/wazero "$1" "${@:2}"
|
2023-04-17 23:13:52 -06:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown Go WASI runtime specified: $GOWASIRUNTIME"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|