From a700f5858146814b4b34ba38dd44011fee364316 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 22 Dec 2022 09:40:43 +0800 Subject: [PATCH] wasi: makes wasmtime "run" explicit wasmtime by default will assume the subcommand is "run" vs one of its others, but being explicit helps clarify the actual command invoked. For example, we pass similar looking args to wasmtime and also wasi. Signed-off-by: Adrian Cole --- main.go | 4 ++-- src/runtime/runtime_wasm_wasi.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index d820cb1f..9df30ef6 100644 --- a/main.go +++ b/main.go @@ -285,9 +285,9 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options // relative directory up to the module root, even if the test never // reads any files. // - // Ex. --dir=.. --dir=../.. --dir=../../.. + // Ex. run --dir=.. --dir=../.. --dir=../../.. dirs := dirsToModuleRoot(result.MainDir, result.ModuleRoot) - var args []string + args := []string{"run"} for _, d := range dirs[1:] { args = append(args, "--dir="+d) } diff --git a/src/runtime/runtime_wasm_wasi.go b/src/runtime/runtime_wasm_wasi.go index bacc30df..42869ba7 100644 --- a/src/runtime/runtime_wasm_wasi.go +++ b/src/runtime/runtime_wasm_wasi.go @@ -24,7 +24,7 @@ func _start() { // Read the command line arguments from WASI. // For example, they can be passed to a program with wasmtime like this: // -// wasmtime ./program.wasm arg1 arg2 +// wasmtime run ./program.wasm arg1 arg2 func init() { __wasm_call_ctors() }