Skip to content

Return error for UDS connections on wasi - #2910

Open
Neol3108 wants to merge 1 commit into
grpc:v0.14.xfrom
Neol3108:tonic-wasi-uds
Open

Neol3108 wants to merge 1 commit into
grpc:v0.14.xfrom
Neol3108:tonic-wasi-uds

Conversation

@Neol3108

@Neol3108 Neol3108 commented Oct 4, 2026

Copy link
Copy Markdown

Motivation

Building a client for wasm32-wasip2 with the channel feature fails because Tonic imports tokio::net::UnixStream on every non-Windows target. Tokio only exposes this type on Unix targets. WASI is neither Windows nor Unix, so the import fails even when the client only uses TCP.

Solution

Use cfg(unix) for the Unix socket implementation and cfg(not(unix)) for the existing unsupported-platform fallback. This matches Tokio’s platform guards and keeps Unix socket requests returning an error on platforms that don’t support them.
Adds tests for Unix socket connections and the fallback, plus a WASI client compile check in CI. The 77 library tests, WASI compile check, Clippy, and formatting checks pass locally.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Neol3108 / name: Noël Hagestein (8203a34)

@Neol3108

Neol3108 commented Oct 4, 2026

Copy link
Copy Markdown
Author

Failing CI seems unrelated

@Neol3108
Neol3108 marked this pull request as ready for review October 4, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant