tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

wasip1 `syscall` package needs `syscall.FDFLAG_NONBLOCK`

Open dgryski opened this issue 1 year ago • 1 comments

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

dgryski avatar Oct 02 '24 18:10 dgryski

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.

aykevl avatar Oct 02 '24 20:10 aykevl

@dgryski @aykevl was this addressed by the changes to use Go stdlib package?

deadprogram avatar Dec 06 '24 13:12 deadprogram

Verified that this is now working:

$ tinygo test -target=wasip1 mime/multipart
ok      mime/multipart  25.250s

Now closing, thanks everyone!

deadprogram avatar Mar 16 '25 09:03 deadprogram

We can probably add mime/multipart to the stdlib packages list to test on WASI in GNUMakefile.

dgryski avatar Mar 16 '25 16:03 dgryski