mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +00:00
wasi preview 2 support (#4027)
* all: wasip2 support Co-authored-by: Randy Reddig <randy.reddig@fastly.com>
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasip1 && !386 && !arm)
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasip1 && !wasip2 && !386 && !arm)
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux && !baremetal && !wasip1 && !wasm_unknown
|
||||
//go:build linux && !baremetal && !wasip1 && !wasip2 && !wasm_unknown
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// fairly similar: we use fdopendir, fdclosedir, and readdir from wasi-libc in
|
||||
// a similar way that the darwin code uses functions from libc.
|
||||
|
||||
//go:build wasip1
|
||||
//go:build wasip1 || wasip2
|
||||
|
||||
package os
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !baremetal && !js && !wasip1 && !wasm_unknown
|
||||
//go:build !baremetal && !js && !wasip1 && !wasip2 && !wasm_unknown
|
||||
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin || linux || wasip1
|
||||
//go:build darwin || linux || wasip1 || wasip2
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || wasip1 || windows
|
||||
//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || wasip1 || wasip2 || windows
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build baremetal || (tinygo.wasm && !wasip1)
|
||||
//go:build baremetal || (tinygo.wasm && !wasip1 && !wasip2)
|
||||
|
||||
package os
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1 || wasip2
|
||||
|
||||
// target wasi sets GOOS=linux and thus the +linux build tag,
|
||||
// even though it doesn't show up in "tinygo info target -wasi"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build windows || darwin || (linux && !baremetal) || wasip1
|
||||
//go:build windows || darwin || (linux && !baremetal) || wasip1 || wasip2
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build windows || darwin || (linux && !baremetal) || wasip1
|
||||
//go:build windows || darwin || (linux && !baremetal) || wasip1 || wasip2
|
||||
|
||||
package os_test
|
||||
|
||||
@@ -275,7 +275,7 @@ func TestDirFS(t *testing.T) {
|
||||
t.Log("TODO: implement Readdir for Windows")
|
||||
return
|
||||
}
|
||||
if runtime.GOOS == "wasip1" {
|
||||
if runtime.GOOS == "wasip1" || runtime.GOOS == "wasip2" {
|
||||
t.Log("TODO: allow foo/bar/. as synonym for path foo/bar on wasi?")
|
||||
return
|
||||
}
|
||||
@@ -296,7 +296,7 @@ func TestDirFSPathsValid(t *testing.T) {
|
||||
t.Log("skipping on Windows")
|
||||
return
|
||||
}
|
||||
if runtime.GOOS == "wasip1" {
|
||||
if runtime.GOOS == "wasip1" || runtime.GOOS == "wasip2" {
|
||||
t.Log("skipping on wasi because it fails on wasi on windows")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1 && !wasip2
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !windows && !baremetal && !js && !wasi && !wasip1 && !wasm_unknown
|
||||
//go:build !windows && !baremetal && !js && !wasip1 && !wasm_unknown
|
||||
|
||||
// Copyright 2024 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !windows && !baremetal && !js && !wasip1
|
||||
//go:build !windows && !baremetal && !js && !wasip1 && !wasip2
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build windows || darwin || (linux && !baremetal && !wasi)
|
||||
//go:build windows || darwin || (linux && !baremetal && !wasip1 && !wasip2)
|
||||
|
||||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1 && !wasip2
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !baremetal && !js && !wasip1 && !wasm_unknown
|
||||
//go:build !baremetal && !js && !wasip1 && !wasip2 && !wasm_unknown
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build baremetal || js || wasi || wasip1 || wasm_unknown
|
||||
//go:build baremetal || js || wasip1 || wasip2 || wasm_unknown
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasi)
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasip1 && !wasip2)
|
||||
|
||||
// TODO: implement ReadDir on windows
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build (linux && !baremetal && 386) || (linux && !baremetal && arm && !wasi)
|
||||
//go:build (linux && !baremetal && 386) || (linux && !baremetal && arm && !wasip1 && !wasip2)
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build (linux && !baremetal && !wasm_unknown) || wasip1
|
||||
//go:build (linux && !baremetal && !wasm_unknown) || wasip1 || wasip2
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build baremetal || (tinygo.wasm && !wasip1)
|
||||
//go:build baremetal || (tinygo.wasm && !wasip1 && !wasip2)
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1 || wasip2
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1 && !wasip2
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1
|
||||
//go:build darwin || (linux && !baremetal && !wasm_unknown) || wasip1 || wasip2
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
Reference in New Issue
Block a user