mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//go:build linux && !baremetal && !wasi
|
||||
//go:build linux && !baremetal && !wasip1
|
||||
|
||||
// This implementation of crypto/rand uses the /dev/urandom pseudo-file to
|
||||
// generate random numbers.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasi && !386 && !arm)
|
||||
//go:build darwin || (linux && !baremetal && !js && !wasip1 && !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 && !wasi && !wasip1
|
||||
//go:build linux && !baremetal && !wasip1
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This file was derived from src/os/dir_darwin.go since the logic for wasi is
|
||||
// This file was derived from src/os/dir_darwin.go since the logic for WASI is
|
||||
// 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 wasi || wasip1
|
||||
//go:build wasip1
|
||||
|
||||
package os
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !baremetal && !js && !wasi
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build baremetal || (wasm && !wasi && !wasip1)
|
||||
//go:build baremetal || (wasm && !wasip1)
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !wasi && !wasip1
|
||||
//go:build !wasip1
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build wasi || wasip1
|
||||
//go:build wasip1
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !baremetal && !js && !wasi && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
|
||||
// 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
|
||||
//go:build !windows && !baremetal && !js && !wasip1
|
||||
|
||||
// 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 !baremetal && !js && !wasi && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
|
||||
// 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 && !wasi && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
|
||||
package os
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build baremetal || (wasm && !wasi && !wasip1)
|
||||
//go:build baremetal || (wasm && !wasip1)
|
||||
|
||||
// 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 && !wasi && !wasip1
|
||||
//go:build !baremetal && !js && !wasip1
|
||||
|
||||
package os_test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build (!wasi && !runtime_memhash_tsip && !runtime_memhash_leveldb) || (wasi && runtime_memhash_fnv)
|
||||
//go:build (!wasip1 && !runtime_memhash_tsip && !runtime_memhash_leveldb) || (wasip1 && runtime_memhash_fnv)
|
||||
|
||||
// This is the default for all targets except WASI, unless a more specific build
|
||||
// tag is set.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build runtime_memhash_leveldb || (wasi && !runtime_memhash_fnv && !runtime_memhash_tsip)
|
||||
//go:build runtime_memhash_leveldb || (wasip1 && !runtime_memhash_fnv && !runtime_memhash_tsip)
|
||||
|
||||
// This is the default for WASI, but can also be used on other targets with the
|
||||
// right build tag.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build linux && !baremetal && !nintendoswitch && !wasi && !wasm_unknown
|
||||
//go:build linux && !baremetal && !nintendoswitch && !wasip1 && !wasm_unknown
|
||||
|
||||
package runtime
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build (darwin || (linux && !baremetal && !wasi && !wasm_unknown)) && !nintendoswitch
|
||||
//go:build (darwin || (linux && !baremetal && !wasip1 && !wasm_unknown)) && !nintendoswitch
|
||||
|
||||
package runtime
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build tinygo.wasm && (wasi || wasip1)
|
||||
//go:build wasip1
|
||||
|
||||
package runtime
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build wasm && !wasi && !wasip1
|
||||
//go:build wasm && !wasip1
|
||||
|
||||
package runtime
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !wasi && !wasip1 && !darwin
|
||||
//go:build !wasip1 && !darwin
|
||||
|
||||
package syscall
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build wasi || wasip1
|
||||
//go:build wasip1
|
||||
|
||||
package syscall
|
||||
|
||||
@@ -397,8 +397,16 @@ func Chmod(path string, mode uint32) (err error) {
|
||||
return Lstat(path, &stat)
|
||||
}
|
||||
|
||||
// wasmPageSize is the size of a page in WebAssembly's 32-bit memory. This
|
||||
// is also its only unit of change.
|
||||
//
|
||||
// See https://www.w3.org/TR/wasm-core-1/#page-size
|
||||
//
|
||||
// FIXME: this is also defined in package runtime.
|
||||
const wasmPageSize = 64 * 1024
|
||||
|
||||
func Getpagesize() int {
|
||||
return libc_getpagesize()
|
||||
return wasmPageSize
|
||||
}
|
||||
|
||||
type Utsname struct {
|
||||
@@ -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 !wasi && !wasip1
|
||||
//go:build !wasip1
|
||||
|
||||
package testing_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 wasi || wasip1
|
||||
//go:build wasip1
|
||||
|
||||
package testing_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user