Stream: web-preview

Topic: Initial wasi-libc support


view this post on Zulip Alex Crichton (Oct 28 2026 at 15:26):

Ben FWIW I think it's reasonable to mostly go ahead and land https://github.com/WebAssembly/wasi-libc/pull/883 where it's at with notes on various follow-ups. I feel that it's in a reasonable enough shape for prototyping/testing and as a blocker for doing lots of other stuff I think it's ok to not try to get it absolutely perfect before landing (insofar as while I could debate stdio further I think we're in the diminishing returns phase)

view this post on Zulip Ben Visness (Oct 28 2026 at 17:22):

Sounds good. Thanks for all your feedback; I do think it's in a much better overall place now. I'll try and get the testing stuff figured out soon + stdout as a TTY and then try to get it landed.

view this post on Zulip Ben Visness (Oct 28 2026 at 17:23):

And then I guess the next thing would be to pull it into wasi-sdk, and then at that point hopefully we're able to start doing some end-to-end iteration.

view this post on Zulip Ben Visness (Oct 28 2026 at 17:23):

Ryan and I are also working through reviews on a lot of the Firefox implementation, so hopefully it won't be too long before we can even start writing some early docs.

view this post on Zulip Ben Visness (Nov 09 2026 at 18:40):

Finally back to finish up the last couple things and get this merged. @Alex Crichton, I have a weird confluence of problems around __clock_nanosleep and futexes. One of the tests is going into an infinite loop of "Uncaught Error: clock_nanosleep is not supported" because musl's __timedwait isn't prepared for ENOSYS.

view this post on Zulip Ben Visness (Nov 09 2026 at 18:40):

Specifically this, I think: https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/src/thread/common/__timedwait.c#L62

view this post on Zulip Ben Visness (Nov 09 2026 at 18:41):

As this works through the whole system it gets down to __clock_nanosleep, which logs and returns ENOSYS, which ends up here as -ENOSYS, which then isn't on the list of approved errors (EINTR, ETIMEDOUT, ECANCELED) and therefore returns...0.

view this post on Zulip Ben Visness (Nov 09 2026 at 18:42):

So the error just gets masked in this really dumb way. It seems this used to trap before you did https://github.com/WebAssembly/wasi-libc/pull/900

view this post on Zulip Ben Visness (Nov 09 2026 at 18:44):

But it's not clear to me what the right fix is. Adding ENOSYS to that list of errors seems wrong, and honestly trapping would probably be fine, so should I just update futex.c to go back to unconditionally trapping for webp2?

view this post on Zulip Alex Crichton (Nov 09 2026 at 18:56):

should I just update futex.c to go back to unconditionally trapping for webp2?

I think that's reasonable yeah, this sounds like basically the same bucket as sleep where errors either cannot be, or cannot practically be, communicated

view this post on Zulip Ben Visness (Nov 09 2026 at 19:19):

I also have some new test failures because you can't set O_NONBLOCK on webp2's stdio. Suggestions on how to handle that one?

view this post on Zulip Ben Visness (Nov 09 2026 at 19:22):

Hm, maybe I can persuade those tests to pass

view this post on Zulip Ben Visness (Nov 09 2026 at 19:32):

Yeah false alarm there, I can just roundtrip the nonblocking flag and those pass

view this post on Zulip Ben Visness (Nov 09 2026 at 20:24):

I think it's ready for what I hope is one last look. The only outstanding comments are about UTF-8 validation (where I would prefer to keep it the same) and wasmtime version shenanigans. Maybe I'll just poke around in the meantime and see if I could resolve the wasmtime version issue now.

view this post on Zulip Alex Crichton (Nov 09 2026 at 21:13):

Thanks again for your work here!


Last updated: Nov 19 2026 at 20:05 UTC