wasi preview 2 support (#4027)

* all: wasip2 support

Co-authored-by: Randy Reddig <randy.reddig@fastly.com>
This commit is contained in:
Damian Gryski
2024-07-02 07:02:03 -07:00
committed by GitHub
parent f18c6e342f
commit 9cb263479c
125 changed files with 7035 additions and 154 deletions
+1 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
//go:build baremetal || (tinygo.wasm && !wasip1)
//go:build baremetal || (tinygo.wasm && !wasip1 && !wasip2)
package os
+1 -1
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
//go:build windows || darwin || (linux && !baremetal) || wasip1
//go:build windows || darwin || (linux && !baremetal) || wasip1 || wasip2
package os_test
+3 -3
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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 -1
View File
@@ -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