From ea832007dc1bb0cefaffd0bb6fb2cae3a92af501 Mon Sep 17 00:00:00 2001 From: Alex Ackerman <22874423+darkhonor@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:51:31 +0900 Subject: [PATCH] Gate `mod timespec` on the `net` feature Both backends' `sockopt` modules reference `crate::timespec` unconditionally for `SO_RCVTIMEO` and `SO_SNDTIMEO`, but `mod timespec` was not gated in by `net`. Building with only `net` enabled therefore failed: error[E0433]: cannot find `timespec` in `crate` six times via the linux_raw backend and three via libc. This affects consumers that set `default-features = false` and opt into a minimal API surface rather than taking the defaults. 1.1.4 was unaffected. `src/timespec.rs` depends only on `core`, `crate::backend::c` and `crate::ffi`, so gating it on `net` pulls in no further feature-gated code. Gating the `sockopt` timeout code instead would also compile, but would silently drop `SO_RCVTIMEO` and `SO_SNDTIMEO` from a `net`-only build. Adds `net` and `net,use-libc` to the --no-default-features CI job, matching the existing `time` and `time,use-libc` checks, so the combination does not regress again. --- .github/workflows/main.yml | 2 ++ src/lib.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21df08597..e39e86fc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -188,6 +188,8 @@ jobs: - run: cargo check --workspace --release --no-default-features --features all-apis,use-libc,alloc -vv - run: cargo check --workspace --release --no-default-features --features time -vv - run: cargo check --workspace --release --no-default-features --features time,use-libc -vv + - run: cargo check --workspace --release --no-default-features --features net -vv + - run: cargo check --workspace --release --no-default-features --features net,use-libc -vv - run: rustup component add rust-src - run: cargo check --workspace --release --no-default-features --target=i686-unknown-linux-gnu -Zbuild-std -vv diff --git a/src/lib.rs b/src/lib.rs index 8109ca2bb..078c382a1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -389,6 +389,7 @@ mod signal; #[cfg(any( feature = "fs", feature = "event", + feature = "net", feature = "process", feature = "runtime", feature = "thread",