Skip to content

Compile timespec for net feature - #1681

Open
HalFrgrd wants to merge 1 commit into
bytecodealliance:mainfrom
HalFrgrd:main
Open

HalFrgrd wants to merge 1 commit into
bytecodealliance:mainfrom
HalFrgrd:main

Conversation

@HalFrgrd

Copy link
Copy Markdown
Contributor

Fixes the problem found here #1655 (comment)

@ogoffart

Copy link
Copy Markdown

Thanks for the PR

@sunfishcode would be nice to have a release, because rustix 1.1.5 is failling to compile on our android CI

@darkhonor

Copy link
Copy Markdown

This is the right fix, and it predates the duplicate I opened in #1690, which I have closed in favour of this one.

Offering one thing from it in case it is useful here rather than as a separate PR. The check_no_default_features job already checks time and time,use-libc individually, and the same pair for net would have caught this:

    - run: cargo check --workspace --release --no-default-features --features net -vv
    - run: cargo check --workspace --release --no-default-features --features net,use-libc -vv

Verified against v1.1.5 on rustc 1.98.1 with the job's own RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths: net fails with six E0433s through the linux_raw backend and net,use-libc with three through libc, and both pass with the one-line change in this PR. Entirely your call whether it belongs here or not at all.

Context on the impact, since a release is already being asked for above: this also breaks consumers that set default-features = false to opt into a minimal API surface. Full repro and verification matrix are in #1689, which I am closing as a duplicate of this.

darkhonor added a commit to darkhonor/maknae that referenced this pull request Sep 23, 2026
AGENTS.md requires every version pin to record the failure it prevents. The
two rustix pins said why rustix rather than nix, and why the feature set is
minimal, but not why the version is exact. Dependabot #340 proposed 1.1.5 and
the answer existed only in that PR's review.

rustix 1.1.5 does not compile under `default-features = false,
features = ["std", "net"]`. Both backends' net sockopt code references
`crate::timespec` for SO_RCVTIMEO/SO_SNDTIMEO, but `mod timespec` is gated on
fs/event/process/runtime/thread/time and not on `net`:

    error[E0433]: cannot find `timespec` in `crate`

six times through linux_raw, three through libc, which is what build-and-gate
and darwin-cross reported on #340. 1.1.4 is unaffected.

This is the cost of the minimal feature set rather than a fault in it: taking
default features would compile in precisely the APIs the pin exists to
exclude. The upstream fix is bytecodealliance/rustix#1681, one line adding
`net` to the gate; it is green and awaiting merge. Lift both pins to >=1.1.6
once it releases.

No Dependabot ignore rule is added. .github/dependabot.yml carries none by
decision (#320, 2026-09-19), and the workflow it prescribes is the one that
worked here: an ordinary bump, reviewed against the pin comment, closed
because it cannot keep the comment true.

Comments only; no dependency, feature or version changes.
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.

3 participants