Repository navigation
fix(moq-sock,moq-relay): macOS and Windows compile without warnings again - #8858
Conversation
…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>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: the single commit, covering all three files.
moq-relayhandoff check:bail!behind#[cfg(not(linux))]becomesensure!(cfg!(target_os = "linux"), ...). Behavior is unchanged, and the code after it stays reachable on every platform.moq-sockdead code:Programtakescfg_attr(not(linux), expect(dead_code)), and the Linux-only test constsV1/V2are gated to Linux. Theexpectfails loudly if the fields ever become read off Linux.moq-transcodebench: the unconditionalDurationimport is dropped andstd::time::Durationis spelled inside the#[cfg(unix)]thread_cpu.Durationhas 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.
claude-sonnet-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughWhen Merge Risk:
|
…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>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior review (0d38efa → fead3f6):
- Gated Linux-only handoff items:
SUPERVISE_FLAGandrelay_argsare now#[cfg(any(target_os = "linux", test))]. - Reasoned expectations:
EventsandProgramuseexpect(dead_code, reason = ...)off Linux, replacing the bareallow(dead_code)attributes.
claude-sonnet-5-5 | 𝕏

Problem
Nightly run 43724172821 fails
platform / macOSandplatform / Windowsatjust rs macos-test/windows-test. Those runcargo nextestunderCARGO_BUILD_WARNINGS=deny, and off Linuxmoq-sockwarns:rs/moq-sock/src/shard.rs:750:Program'scount,total,base, andexactare never read (only Linux'sinsnsreads them; the off-Linuxattachstub drops the program).shard.rs:1063: the test constsV1/V2are 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-sockcompiles:rs/moq-relay/src/config.rs:397: unreachable statement after the#[cfg(not(target_os = "linux"))] bail!.rs/moq-transcode/benches/ladder.rs:18importsDurationthat only the#[cfg(unix)]thread_cpuuses.allow_attributes_without_reason), surfaced oncemoq-sockcompiled:rs/moq-relay/src/handoff.rshad threecfg_attr(not(linux), allow(dead_code))without a reason.Approach
V1/V2get#[cfg(target_os = "linux")]like their readers.Programtakes#[cfg_attr(not(target_os = "linux"), expect(dead_code, reason = ...))]. A cfg gate would have to splitBound::steer,Bound::steering, andSteeringtoo, since off Linux a group never binds (its first member'sSO_REUSEPORTbind is refused) yet the public types still compile there;expectalso fails loudly if the fields ever become read off Linux.anyhow::ensure!(cfg!(target_os = "linux"), ...), so the Linux checks after it stay reachable code on every platform.handoff.rs,SUPERVISE_FLAGandrelay_argsbecome#[cfg(any(target_os = "linux", test))], their only readers;Events(built on every platform, read only by Linux'sHandoff::run, uninhabited elsewhere) takesexpect(dead_code)with a reason.std::time::Durationinsidethread_cpuand drops the import.Owned elsewhere
The other compile failures in that run are already handled, so this PR leaves them alone:
rs hls-conformance:quic::Client::is_simulatedunused under moq-hls'stcp,quic;features:sim.rsephemeral/network/bindunderdriver,runtime::spawnundernet/qmux/quic): moq-dev/moq#8852 removes those features, sois_simulated's websocket caller is unconditional andtokio-featuresgoes away. Still reproducible on main today (CARGO_BUILD_WARNINGS=deny cargo test --no-run -p moq-hls --test integrationfails onis_simulated); it clears when feat(moq-tokio,moq-relay,qmux)!: always compile the network stack #8852 lands.json-properties(js/json/bench/stream.tsTS2741 missingat): already fixed on main by moq-dev/moq#8798, which landed after the run's head505a86f173.bunx tsc --noEmit --project js/json/bench/tsconfig.jsonpasses on main.AtomicU64::fetch_updateinrs/moq-net/src/model/cache.rs: no deprecation warning from the pinned 1.98.1 toolchain (cargo clippy -p moq-net --all-targets -- -D warningsis clean) and none in the Nightly logs, so nothing denies it; left alone.Impact
None: no public API or wire change.
Validation
CARGO_BUILD_WARNINGS=deny cargo clippy --locked -p moq-net -p moq-sock -p moq-relay -p moq-transcode --all-targets -- -D warningsclean;just checkpasses.platform.ymlwas dispatched on this branch. The first run (43739979429) passed macOS and failed Windows on thehandoff.rsallows; 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-reasonclean on Linux.Caused by
attach'scountargument into aProgramstruct whose fields only Linux reads, added test consts used only on Linux, and put Linux-only checks after an off-Linuxbail!, and marked handoff's Linux-only items with reasonlessallow(dead_code)(found by check)Durationunconditionally for a#[cfg(unix)]helper (found by check)Alternatives
Program,attach, and the steering methods to Linux: more cfg surface across public types for no behavior change.Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Opus 5.5)
Review
Rewritten by
quest reviewafter 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 mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e034-7917-7191-9caf-f3853329d775, round 2Score: 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