From 1598fe6dfebc57ab6618ca176cc11d0eabb8f748 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Tue, 9 Jun 2026 11:41:21 -0700 Subject: [PATCH 1/2] Add support for wasm32-unknown-emscripten Gate the relevant Unix socket option cfgs on target_os = "emscripten" and add the target to CI. --- .github/workflows/main.yml | 1 + CHANGELOG.md | 4 ++++ src/socket.rs | 2 ++ src/sys/unix.rs | 6 ++++++ 4 files changed, 13 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ffaf31e..7d8e949a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,6 +109,7 @@ jobs: - x86_64-unknown-netbsd - x86_64-unknown-openbsd - x86_64-unknown-redox + - wasm32-unknown-emscripten - wasm32-wasip2 steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 633bbc30..60593d75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Unreleased + +* Added support for wasm32-unknown-emscripten. + # 0.6.4 * Implement Send for `MsgHdr`(`Mut`) diff --git a/src/socket.rs b/src/socket.rs index defbb1e0..0c8d4997 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -2252,6 +2252,7 @@ impl Socket { any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "illumos", @@ -2283,6 +2284,7 @@ impl Socket { any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "illumos", diff --git a/src/sys/unix.rs b/src/sys/unix.rs index be9b6dad..9a1b6e87 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -301,6 +301,7 @@ pub(crate) use libc::{IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, IP_MULTICAST_IF, M any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "illumos", @@ -411,6 +412,7 @@ type IovLen = usize; ), target_os = "aix", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "haiku", @@ -466,6 +468,7 @@ impl Type { any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "illumos", @@ -486,6 +489,7 @@ impl Type { any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "hurd", @@ -505,6 +509,7 @@ impl Type { #[cfg(any( target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "hurd", @@ -1278,6 +1283,7 @@ pub(crate) fn set_tcp_keepalive(fd: RawSocket, keepalive: &TcpKeepalive) -> io:: target_os = "aix", target_os = "android", target_os = "dragonfly", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "hurd", From 1c56a180a42da05403db3a1718c5ea61e5751d40 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Tue, 9 Jun 2026 12:09:55 -0700 Subject: [PATCH 2/2] Remove unreleased section from CHANGELOG --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60593d75..633bbc30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,3 @@ -# Unreleased - -* Added support for wasm32-unknown-emscripten. - # 0.6.4 * Implement Send for `MsgHdr`(`Mut`)