Skip to content

fix(moq-sock,moq-relay): macOS and Windows compile without warnings again - #8858

Merged
kixelated merged 2 commits into
mainfrom
fix/nightly-deny-warnings
Nov 16, 2026
Merged

kixelated merged 2 commits into
mainfrom
fix/nightly-deny-warnings

Conversation

@kixelated

@kixelated kixelated commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Nightly run 43724172821 fails platform / macOS and platform / Windows at just rs macos-test / windows-test. Those run cargo nextest under CARGO_BUILD_WARNINGS=deny, and off Linux moq-sock warns:

  • rs/moq-sock/src/shard.rs:750: Program's count, total, base, and exact are never read (only Linux's insns reads them; the off-Linux attach stub drops the program).
  • shard.rs:1063: the test consts V1/V2 are never used (every reader is #[cfg(target_os = "linux")]).

The same platform check steps also warn, and the denied test step would hit next once moq-sock compiles:

  • rs/moq-relay/src/config.rs:397: unreachable statement after the #[cfg(not(target_os = "linux"))] bail!.
  • Windows only: rs/moq-transcode/benches/ladder.rs:18 imports Duration that only the #[cfg(unix)] thread_cpu uses.
  • Windows test step (clippy-driver with allow_attributes_without_reason), surfaced once moq-sock compiled: rs/moq-relay/src/handoff.rs had three cfg_attr(not(linux), allow(dead_code)) without a reason.

Approach

  • V1/V2 get #[cfg(target_os = "linux")] like their readers.
  • Program takes #[cfg_attr(not(target_os = "linux"), expect(dead_code, reason = ...))]. A cfg gate would have to split Bound::steer, Bound::steering, and Steering too, since off Linux a group never binds (its first member's SO_REUSEPORT bind is refused) yet the public types still compile there; expect also fails loudly if the fields ever become read off Linux.
  • The handoff refusal becomes anyhow::ensure!(cfg!(target_os = "linux"), ...), so the Linux checks after it stay reachable code on every platform.
  • In handoff.rs, SUPERVISE_FLAG and relay_args become #[cfg(any(target_os = "linux", test))], their only readers; Events (built on every platform, read only by Linux's Handoff::run, uninhabited elsewhere) takes expect(dead_code) with a reason.
  • The bench spells std::time::Duration inside thread_cpu and drops the import.

Owned elsewhere

The other compile failures in that run are already handled, so this PR leaves them alone:

  • moq-tokio feature shapes (rs hls-conformance: quic::Client::is_simulated unused under moq-hls's tcp,quic; features: sim.rs ephemeral/network/bind under driver, runtime::spawn under net/qmux/quic): moq-dev/moq#8852 removes those features, so is_simulated's websocket caller is unconditional and tokio-features goes away. Still reproducible on main today (CARGO_BUILD_WARNINGS=deny cargo test --no-run -p moq-hls --test integration fails on is_simulated); it clears when feat(moq-tokio,moq-relay,qmux)!: always compile the network stack #8852 lands.
  • json-properties (js/json/bench/stream.ts TS2741 missing at): already fixed on main by moq-dev/moq#8798, which landed after the run's head 505a86f173. bunx tsc --noEmit --project js/json/bench/tsconfig.json passes on main.
  • AtomicU64::fetch_update in rs/moq-net/src/model/cache.rs: no deprecation warning from the pinned 1.98.1 toolchain (cargo clippy -p moq-net --all-targets -- -D warnings is clean) and none in the Nightly logs, so nothing denies it; left alone.

Impact

None: no public API or wire change.

Validation

  • Linux: CARGO_BUILD_WARNINGS=deny cargo clippy --locked -p moq-net -p moq-sock -p moq-relay -p moq-transcode --all-targets -- -D warnings clean; just check passes.
  • macOS/Windows: no non-Linux Rust std is installed locally, so platform.yml was dispatched on this branch. The first run (43739979429) passed macOS and failed Windows on the handoff.rs allows; after that fix, 43743249508 passes both macOS and Windows (just rs macos[-test], just rs windows[-test], Swift, C, C++, OBS).
  • CARGO_BUILD_WARNINGS=deny cargo clippy --locked -p moq-relay --all-targets -- -D warnings -W clippy::allow-attributes-without-reason clean on Linux.

Caused by

  • moq-dev/moq#8596 - turned attach's count argument into a Program struct whose fields only Linux reads, added test consts used only on Linux, and put Linux-only checks after an off-Linux bail!, and marked handoff's Linux-only items with reasonless allow(dead_code) (found by check)
  • moq-dev/moq#7375 - imported Duration unconditionally for a #[cfg(unix)] helper (found by check)

Alternatives

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: fead3f6

  • Base: origin/main at 073418d

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1e034-7917-7191-9caf-f3853329d775, round 2

  • Score: 10/10, The incremental changes correctly gate Linux-only helpers while preserving test coverage and runtime behavior, with no actionable defects found by source inspection; builds and tests were not run as instructed.

  • Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

…gain

Program's fields and the test's V1/V2 are read only by Linux's steering
filter, the off-Linux handoff refusal no longer leaves the Linux checks
unreachable, and the transcode bench imports Duration only where it uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 15, 2026 17:15
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 15, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the single commit, covering all three files.

  • moq-relay handoff check: bail! behind #[cfg(not(linux))] becomes ensure!(cfg!(target_os = "linux"), ...). Behavior is unchanged, and the code after it stays reachable on every platform.
  • moq-sock dead code: Program takes cfg_attr(not(linux), expect(dead_code)), and the Linux-only test consts V1/V2 are gated to Linux. The expect fails loudly if the fields ever become read off Linux.
  • moq-transcode bench: the unconditional Duration import is dropped and std::time::Duration is spelled inside the #[cfg(unix)] thread_cpu. Duration has no other use in the file.

I reviewed this by reading the diff only. I did not build it on macOS or Windows, and the PR links a platform.yml run for that.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When handoff.socket is configured, Config::check_handoff checks the Linux condition on all targets. Non-Linux targets retain the same error. Shard code adds a non-Linux dead-code allowance and gates the V1 and V2 test constants to Linux. The benchmark removes the Duration import and uses fully qualified type names. Its clock measurement and error handling are unchanged.

Merge Risk: Minimal · up to 0d38e

This change only fixes platform-specific compiler warnings on macOS and Windows. It does not change behavior on Linux or any public API. The risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two affected crates and the outcome: macOS and Windows builds no longer emit warnings. It matches the changeset, which gates Linux-only items in moq-sock, reworks the handoff check…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states a specific, related purpose: fixing macOS and Windows warnings under CARGO_BUILD_WARNINGS=deny in moq-sock, moq-relay, and moq-transcode. It names the affected files and lines, …
Full details: Title check

Explanation

The title names the two affected crates and the outcome: macOS and Windows builds no longer emit warnings. It matches the changeset, which gates Linux-only items in moq-sock, reworks the handoff check in moq-relay, and scopes Duration in the moq-transcode bench. The title is slightly broad because it does not mention the moq-transcode bench change, but it captures the main change.

Full details: Description check

Explanation

The description states a specific, related purpose: fixing macOS and Windows warnings under CARGO_BUILD_WARNINGS=deny in moq-sock, moq-relay, and moq-transcode. It names the affected files and lines, the approach taken, validation, and the commits that caused the problems. This matches the changeset in the raw summary, so the check passes.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c7a3a9d-ce8e-4e39-aa32-3b765b371b59
Commits

Reviewing files that changed from the base of the PR and between 844e8e8 and 0d38efa.

Files selected for processing: 3

  • rs/moq-relay/src/config.rs
  • rs/moq-sock/src/shard.rs
  • rs/moq-transcode/benches/ladder.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

…reasonless allows

Windows' clippy-driver test step denies allow attributes without a reason.
The supervise flag and relay_args exist only where Linux or the test reads
them; Events keeps an expect with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior review (0d38efa → fead3f6):

  • Gated Linux-only handoff items: SUPERVISE_FLAG and relay_args are now #[cfg(any(target_os = "linux", test))].
  • Reasoned expectations: Events and Program use expect(dead_code, reason = ...) off Linux, replacing the bare allow(dead_code) attributes.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit fc79705 Nov 16, 2026
12 checks passed
@kixelated
kixelated deleted the fix/nightly-deny-warnings branch November 16, 2026 09:53
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