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 <adrian@tetrate.io>
Этот коммит содержится в:
Adrian Cole 2022-12-22 09:40:43 +08:00 коммит произвёл Ron Evans
родитель e71e289e8b
коммит a700f58581
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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 // relative directory up to the module root, even if the test never
// reads any files. // reads any files.
// //
// Ex. --dir=.. --dir=../.. --dir=../../.. // Ex. run --dir=.. --dir=../.. --dir=../../..
dirs := dirsToModuleRoot(result.MainDir, result.ModuleRoot) dirs := dirsToModuleRoot(result.MainDir, result.ModuleRoot)
var args []string args := []string{"run"}
for _, d := range dirs[1:] { for _, d := range dirs[1:] {
args = append(args, "--dir="+d) args = append(args, "--dir="+d)
} }

Просмотреть файл

@ -24,7 +24,7 @@ func _start() {
// Read the command line arguments from WASI. // Read the command line arguments from WASI.
// For example, they can be passed to a program with wasmtime like this: // 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() { func init() {
__wasm_call_ctors() __wasm_call_ctors()
} }