]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/wasm: silence Wasmtime 14 CLI warning
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 2 Nov 2023 03:08:53 +0000 (23:08 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 2 Nov 2023 21:23:37 +0000 (21:23 +0000)
The latest version of Wasmtime, 14.0.4 as of writing this, offers a new
CLI while also supporting the old CLI. Since this is known and tracked
in issue #63718, silence the warning that otherwise causes many tests
to fail.

Since Wasmtime 13 and older don't pay attention to WASMTIME_NEW_CLI,
this change increases compatibility of the script, letting it work
with Wasmtime 9.0.1 as currently tested by the old cmd/coordinator, and
with Wasmtime 14.0.4 as currently tested in the new LUCI infrastructure.

The rest of the transition is left as future work.

For #63718.
For #61116.

Change-Id: I77d4f74cc1d34a657e48dcaaceb6fbda7d1e9428
Cq-Include-Trybots: luci.golang.try:gotip-wasip1-wasm_wasmtime
Reviewed-on: https://go-review.googlesource.com/c/go/+/538699
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
misc/wasm/go_wasip1_wasm_exec

index 0351994364f427533d92e7579050f79a49e44c34..dc110327af7a6361081c4c7b718c4816e6382870 100755 (executable)
@@ -14,7 +14,8 @@ case "$GOWASIRUNTIME" in
                exec wazero run -mount /:/ -env-inherit -cachedir "${TMPDIR:-/tmp}"/wazero ${GOWASIRUNTIMEARGS:-} "$1" "${@:2}"
                ;;
        "wasmtime" | "")
-               exec wasmtime run --dir=/ --env PWD="$PWD" --env PATH="$PATH" --max-wasm-stack 1048576 ${GOWASIRUNTIMEARGS:-} "$1" -- "${@:2}"
+               # TODO(go.dev/issue/63718): Switch to the new CLI offered in the major version 14 of Wasmtime.
+               exec env WASMTIME_NEW_CLI=0 wasmtime run --dir=/ --env PWD="$PWD" --env PATH="$PATH" --max-wasm-stack 1048576 ${GOWASIRUNTIMEARGS:-} "$1" -- "${@:2}"
                ;;
        *)
                echo "Unknown Go WASI runtime specified: $GOWASIRUNTIME"