From 8e8ad9004f165716e64676ec534def097594484a Mon Sep 17 00:00:00 2001 From: Randy Reddig Date: Mon, 4 Mar 2024 10:26:41 -0800 Subject: all: replace target=wasi with target=wasip1 This eliminates the 'wasi' build tag in favor of 'GOOS=wasip1', introduced in Go 1.21. For backwards compatablity, -target=wasi is a synonym for -target=wasip1. --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 8c0117fa1..16e6dbf60 100644 --- a/main.go +++ b/main.go @@ -285,7 +285,7 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options // Tests are always run in the package directory. cmd.Dir = result.MainDir - // wasmtime is the default emulator used for `-target=wasi`. wasmtime + // wasmtime is the default emulator used for `-target=wasip1`. wasmtime // is a WebAssembly runtime CLI with WASI enabled by default. However, // only stdio are allowed by default. For example, while STDOUT routes // to the host, other files don't. It also does not inherit environment @@ -1548,6 +1548,11 @@ func main() { options.PrintCommands = printCommand } + // Compatibility with legacy -target=wasi + if options.Target == "wasi" { + options.Target = "wasip1" + } + err = options.Verify() if err != nil { fmt.Fprintln(os.Stderr, err.Error()) -- cgit v1.2.3