aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorRandy Reddig <[email protected]>2024-03-04 10:26:41 -0800
committerRon Evans <[email protected]>2024-03-27 16:01:40 +0100
commit8e8ad9004f165716e64676ec534def097594484a (patch)
treedc2c799469dad10a48bdb12de056387d6d52709a /main.go
parent62d8cdb218ff4ff37998ad91f9f9e9e146f70271 (diff)
downloadtinygo-8e8ad9004f165716e64676ec534def097594484a.tar.gz
tinygo-8e8ad9004f165716e64676ec534def097594484a.zip
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.
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 6 insertions, 1 deletions
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())