Repository navigation
Support WASI socket components in SDK and publishing - #187
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Socket-based Rust components can compile for
wasm32-wasip2, but the SDK previously refused their imports and reported every socket-oriented crate as incompatible. This change accepts ordinary WASI TCP, UDP and DNS, adds their host compatibility requirement automatically, and teaches the publisher regression checks to distinguish a compatible socket app from one that would fail on RC5.Depends on App Hub #209. The publisher toolchain is pinned to its exact reviewed head
c317f787ea2f620543000561c2470106644c1fc7. Do not merge before that dependency and the host runtime are reviewed. Released RC5 still cannot run socket components.octo wasm buildadds existinghost-api-v1plushost_api.required: {"wasm.sockets": 1}whenever anywasi:socketsinterface is imported, including DNS. Other requirements are preserved; conflicting ABI versions fail before bundle writes. There is no newrequiresfeature that would break older catalog readers, andnetremains a disclosure.wasm infoexplains compatibility;wasm doctorwarns about backend/feature portability instead of refusing network crate names. Native TLS/library limitations remain explicit.connectbefore linking: the bare WIT export shadows wasi-libc’s socket symbol and was reproduced as an out-of-bounds trap. The compile-fail regression recommendstcp_connect; private helpers remain allowed.std::netcomponent example for bounded TCP/UDP echo and DNS; no SDK socket wrapper. Tests found that Rust's WASI UDP backend does not implementset_read_timeout, so UDP uses a tested nonblocking clock deadline and short sleeps.Validation on macOS:
octo wasm build→wasm info→octo check: 171,358-byte socket component, three typed exports, required API added, gate— PASSED.This validates SDK transport in Wasmtime 49 and structural publisher preparation. It does not publish an app or establish phone, public-network DNS, production socket quota/cancellation, or released-shell acceptance. Those remain host validation responsibilities.