Support building with Tinygo and target `wasi`

Enable building using the tinygo compiler, together with
the `wasi` target.

This combination requires different handling compared to go >= 1.21
and the `wasip1` target. That's because Tinygo compiles using the
GOOS set to `linux` and the `GOARCH` set to `wasi`.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
This commit is contained in:
Flavio Castelli 2023-06-06 11:51:37 +02:00
parent 7165f5e779
commit 032a334035
No known key found for this signature in database
GPG Key ID: F1020D69DC004F48
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,7 @@
//go:build (linux || aix || zos) && !js && !wasi
// +build linux aix zos // +build linux aix zos
// +build !js // +build !js
// +build !wasi
package logrus package logrus

8
terminal_check_wasi.go Normal file
View File

@ -0,0 +1,8 @@
//go:build wasi
// +build wasi
package logrus
func isTerminal(fd int) bool {
return false
}