tinygo
tinygo copied to clipboard
wasip1 `syscall` package needs `syscall.FDFLAG_NONBLOCK`
Go's internal/syscall/unix package expects it, and is needed for some tests
~ $ tinygo test -target=wasip1 mime/multipart
FAIL mime/multipart 0.000s
# internal/syscall/unix
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:19:23: undefined: syscall.FDFLAG_NONBLOCK
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:23:22: undefined: syscall.FDFLAG_NONBLOCK
~ $ tinygo test -target=wasip1 net/mail
FAIL net/mail 0.000s
# internal/syscall/unix
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:19:23: undefined: syscall.FDFLAG_NONBLOCK
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:23:22: undefined: syscall.FDFLAG_NONBLOCK
~ $ tinygo test -target=wasip1 net/textproto
FAIL net/textproto 0.000s
# internal/syscall/unix
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:19:23: undefined: syscall.FDFLAG_NONBLOCK
/Users/dgryski/go/src/go.googlesource.com/go/src/internal/syscall/unix/nonblocking_wasip1.go:23:22: undefined: syscall.FDFLAG_NONBLOCK
I was actually changing some targets over to use the Go stdlib syscall package instead. That would probably solve this issue. See: #4461 for example.
@dgryski @aykevl was this addressed by the changes to use Go stdlib package?
Verified that this is now working:
$ tinygo test -target=wasip1 mime/multipart
ok mime/multipart 25.250s
Now closing, thanks everyone!
We can probably add mime/multipart to the stdlib packages list to test on WASI in GNUMakefile.