mirror of
https://github.com/golang/go
synced 2024-11-25 09:37:56 -07:00
all: add wasip1 support
Fixes #58141 Co-authored-by: Richard Musiol <neelance@gmail.com> Co-authored-by: Achille Roussel <achille.roussel@gmail.com> Co-authored-by: Julien Fabre <ju.pryz@gmail.com> Co-authored-by: Evan Phoenix <evan@phx.io> Change-Id: I49b66946acc90fdf09ed9223096bfec9a1e5b923 Reviewed-on: https://go-review.googlesource.com/c/go/+/479627 Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f7f0d39569
commit
319b75ed33
@ -902,7 +902,7 @@ func TestCompressedSection(t *testing.T) {
|
||||
func TestNoSectionOverlaps(t *testing.T) {
|
||||
// Ensure cmd/link outputs sections without overlaps.
|
||||
switch runtime.GOOS {
|
||||
case "aix", "android", "darwin", "ios", "js", "plan9", "windows":
|
||||
case "aix", "android", "darwin", "ios", "js", "plan9", "windows", "wasip1":
|
||||
t.Skipf("cmd/link doesn't produce ELF binaries on %s", runtime.GOOS)
|
||||
}
|
||||
_ = net.ResolveIPAddr // force dynamic linkage
|
||||
|
@ -5,7 +5,7 @@
|
||||
// Only run where builders (build.golang.org) have
|
||||
// access to compiled packages for import.
|
||||
//
|
||||
//go:build !android && !ios && !js
|
||||
//go:build !android && !ios && !js && !wasip1
|
||||
|
||||
package types_test
|
||||
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
. "io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -70,6 +71,9 @@ func TestReadOnlyWriteFile(t *testing.T) {
|
||||
if os.Getuid() == 0 {
|
||||
t.Skipf("Root can write to read-only files anyway, so skip the read-only test.")
|
||||
}
|
||||
if runtime.GOOS == "wasip1" {
|
||||
t.Skip("file permissions are not supported by wasip1")
|
||||
}
|
||||
|
||||
// We don't want to use TempFile directly, since that opens a file for us as 0600.
|
||||
tempDir, err := TempDir("", t.Name())
|
||||
|
@ -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 !windows && !plan9 && !js
|
||||
//go:build !windows && !plan9 && !js && !wasip1
|
||||
|
||||
package syslog
|
||||
|
||||
|
@ -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 unix || (js && wasm)
|
||||
//go:build unix || (js && wasm) || wasip1
|
||||
|
||||
package mime
|
||||
|
||||
|
@ -612,8 +612,9 @@ func testWalk(t *testing.T, walk func(string, fs.WalkDirFunc) error, errVisit in
|
||||
// Test permission errors. Only possible if we're not root
|
||||
// and only on some file systems (AFS, FAT). To avoid errors during
|
||||
// all.bash on those file systems, skip during go test -short.
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("skipping on Windows")
|
||||
// Chmod is not supported on wasip1.
|
||||
if runtime.GOOS == "windows" || runtime.GOOS == "wasip1" {
|
||||
t.Skip("skipping on " + runtime.GOOS)
|
||||
}
|
||||
if os.Getuid() == 0 {
|
||||
t.Skip("skipping as root")
|
||||
|
@ -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 unix || (js && wasm)
|
||||
//go:build unix || (js && wasm) || wasip1
|
||||
|
||||
package filepath
|
||||
|
||||
|
@ -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 !js
|
||||
//go:build !js && !wasip1
|
||||
|
||||
// TODO(@musiol, @odeke-em): re-unify this entire file back into
|
||||
// example.go when js/wasm gets an os.Pipe implementation
|
||||
|
@ -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 js
|
||||
//go:build js || wasip1
|
||||
|
||||
package testing
|
||||
|
@ -59,7 +59,7 @@ func testProg(dir, name string, length int, msg string) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
if runtime.GOOS == "js" || runtime.Compiler != "gc" {
|
||||
if runtime.GOOS == "js" || runtime.GOOS == "wasip1" || runtime.Compiler != "gc" {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,!android,gc
|
||||
// +build !nacl,!js,!wasip1,!android,gc
|
||||
// run
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,!android,!gccgo
|
||||
// +build !nacl,!js,!wasip1,!android,!gccgo
|
||||
// run
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run
|
||||
// +build !js
|
||||
// +build !js,!wasip1
|
||||
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run
|
||||
//go:build !nacl && !js && !gccgo
|
||||
//go:build !nacl && !js && !wasip1 && !gccgo
|
||||
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !js,gc
|
||||
// +build !js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run
|
||||
|
||||
// +build !nacl,!js,!gccgo
|
||||
// +build !nacl,!js,!wasip1,!gccgo
|
||||
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !js,gc
|
||||
// +build !js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !js,gc
|
||||
// +build !js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js
|
||||
// +build !nacl,!js,!wasip1
|
||||
// run
|
||||
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,!gccgo
|
||||
// +build !nacl,!js,!wasip1,!gccgo
|
||||
// run
|
||||
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,!gccgo
|
||||
// +build !nacl,!js,!wasip1,!gccgo
|
||||
// run
|
||||
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run
|
||||
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,!wasip1,gc
|
||||
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,7 +1,7 @@
|
||||
// buildrun -t 45
|
||||
|
||||
//go:build !js
|
||||
// +build !js
|
||||
//go:build !js && !wasip1
|
||||
// +build !js,!wasip1
|
||||
|
||||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,6 +1,6 @@
|
||||
// run
|
||||
//go:build !js
|
||||
// +build !js
|
||||
//go:build !js && !wasip1
|
||||
// +build !js,!wasip1
|
||||
|
||||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !js,gc
|
||||
// +build !js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js
|
||||
// +build !nacl,!js,!wasip1
|
||||
// run
|
||||
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,gc,!wasip1
|
||||
// run
|
||||
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,gc
|
||||
// +build !nacl,!js,!wasip1,gc
|
||||
// run
|
||||
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// errorcheck -0 -m -live -std
|
||||
|
||||
// +build !windows,!js
|
||||
// +build !windows,!js,!wasip1
|
||||
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !nacl,!js,!aix,!gcflags_noopt,gc
|
||||
// +build !nacl,!js,!aix,!wasip1,!gcflags_noopt,gc
|
||||
// run
|
||||
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !plan9,!windows
|
||||
// +build !plan9,!windows,!wasip1
|
||||
// run
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
|
Loading…
Reference in New Issue
Block a user