Stream: git-wasmtime

Topic: wasmtime / PR #12225 wasi-sockets: Allow implicit binds i...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 21:48):

badeend opened PR #12225 from badeend:implicit-binds to bytecodealliance:main:

In 0.2, implicit binds were explicitly forbidden, because that would bypass the concept of network handles.
0.3 doesn't have network handles and sockets are allowed to perform implicit binds again. This affects:

Eventually, this will also allow us to remove the double bookkeeping like this from wasi-libc.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 21:48):

badeend requested wasmtime-wasi-reviewers for a review on PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 21:48):

badeend requested dicej for a review on PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 21:48):

badeend requested wasmtime-core-reviewers for a review on PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 21:54):

badeend updated PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 15:22):

alexcrichton submitted PR review:

Thanks for the comprehensive tests and the implementation here, much appreciated!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 20:57):

badeend updated PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:00):

badeend updated PR #12225.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:18):

badeend commented on PR #12225:

Interesting. I was under the impression that implicit bind was a well-known universal behavior, but after some more research it appears to be a bit more nuanced than I thought. I've added a comment in the code with my findings.

But practically, Linux & MacOS both successfully ran to completion with:

test p3::p3_sockets_tcp_listen ... ok

So they perform an implicit bind as expected (but not clearly documented). I assume this behavior extrapolates to other *BSD flavors.

But apparently, Windows _requires_ bind to be called before listen. To take away any potential platform-specific differences, I've updated the code to always perform the "implicit" bind ourselves in case the socket wasn't explicitly bound by the guest.

Assuming this actually fixes the CI problems, I'll open a PR for a spec change to add a clarification on the listen method.

@alexcrichton Could you review the changes I just added?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:29):

alexcrichton commented on PR #12225:

Sounds right to me yeah, and thanks for investigating!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:52):

alexcrichton merged PR #12225.


Last updated: Jan 09 2026 at 13:15 UTC