Repository navigation
fix(moq-relay): build the io_uring runtime only where io-uring has bindings - #8968
Conversation
…ndings moq-relay depended on moq-uring on every Linux target since #8852, so the armv7 release build (and `cargo install` on 32-bit Linux) hit io-uring's compile_error for its prebuilt bindings. A build.rs sets cfg(uring) for Linux on x86_64, aarch64, riscv64, loongarch64, and powerpc64, matching the dependency's target, and runtime.io_uring refuses elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed d49f6bb98e910d8a8669a10e59b1b115d4a6f8bb. No blocker. The target dependencies, build-script cfg, and Nix graph use the same architecture list as io-uring’s prebuilt bindings. Linux handoff remains independent, and unsupported targets reject explicit io_uring instead of silently choosing another runtime. Keep the armv7 release build as the regression check; I did not independently cross-compile it.
There was a problem hiding this comment.
ℹ️ No critical issues. One gap remains: the test build on 32-bit Linux.
Reviewed changes
This review covers the one commit that restricts moq-relay's io_uring runtime to Linux targets where io-uring ships prebuilt bindings.
- Dependency gate:
moq-uringandweb-transport-protomove from the Linux-wide[dependencies]table to one gated on Linux and the five 64-bit architectures.nix/Cargo.nixgets the same gate. cfg(uring)viabuild.rs: a new build script setscfg(uring)for the same targets. Every relay site that touches the io_uring path (lib.rs,relay.rs,internal.rs,incoming.rs,auth.rs) now switches onuringinstead oftarget_os = "linux". The handoff code stays Linux-wide.- Config refusal:
runtime.io_uring = trueis now refused undernot(uring), and the error names the supported architectures. - Docs:
doc/bin/relay/config.mdand theruntime.rsfield doc now give the architecture requirement.
The library side looks complete. Every moq_uring and crate::uring reference in src/ sits behind uring. The cfg/not(cfg) pairs in relay.rs and internal.rs still cover both cases, and the build script's list matches the Cargo target expression.
ℹ️ The dev-dependency and integration tests are still gated only on Linux
The library build is fixed, but the test build is not. rs/moq-relay/Cargo.toml still has [target.'cfg(target_os = "linux")'.dev-dependencies] moq-uring = { …, features = ["_manual"] }. So cargo test -p moq-relay or cargo check --all-targets on armv7 Linux still compiles io-uring and hits the same compile_error!. The integration tests also call moq_uring and set runtime.io_uring = true under target_os = "linux". On armv7 they would fail to resolve the crate, or would now be refused at config check. The PR's validation ran cargo check without --all-targets, which is why it missed this. The release job isn't affected; this is the "Raspberry Pi user" case from the PR description, applied to tests.
Technical details
# Gate moq-relay's test-side io_uring use on the same architectures
## Affected sites
- rs/moq-relay/Cargo.toml:132 — `[target.'cfg(target_os = "linux")'.dev-dependencies]` pulls `moq-uring` (`_manual`) on every Linux arch
- nix/Cargo.nix — the matching `moq-uring` devDependency entry still has `target = ("linux" == target."os")`
- rs/moq-relay/tests/integration/runtime_uring.rs:8 — `#![cfg(target_os = "linux")]`
- rs/moq-relay/tests/integration/peer_limits.rs:354 — `uring_peer_session_widens_quic_limits` uses `moq_uring::Worker`
- io_uring sites in tests/integration/{embed,tenant_matrix,refusals,wire_stats,handoff,bitrate_caps}.rs that are gated on `target_os = "linux"`
## Required outcome
- `cargo check -p moq-relay --all-targets --target armv7-unknown-linux-gnueabihf` builds, and io-uring is absent from that target's dev graph.
## Suggested approach
- Move `moq-uring` out of the Linux dev-deps into a dev-deps table gated on the same arch `cfg` (keep `socket2` Linux-wide), then regenerate Cargo.nix.
- Build-script `rustc-cfg` also applies to the package's integration tests, so switch the io_uring-only test gates to `cfg(uring)`. Handoff and tokio-worker tests stay on `target_os = "linux"`.claude-opus-5-5 | 𝕏
The dev-dependency on moq-uring and the io_uring integration tests were still Linux-wide, so `cargo test` on armv7 Linux compiled io-uring and hit its compile_error!. They now follow cfg(uring); handoff and tokio-worker tests stay Linux-wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re Pullfrog's note on the test build: fixed in 6649422. The (Written by Opus 5.5) |
There was a problem hiding this comment.
✅ No new issues found. The test-side gap from the prior review is closed.
Reviewed changes
This review covers what changed since the prior Pullfrog review: the test-build gating commit and a merge from main.
- Dev-dependency gate:
moq-uring(_manual) moved into a dev-dependencies table gated on the same Linux-plus-architecturecfgas the normal dependency.socket2stays Linux-wide, andnix/Cargo.nixmirrors the change. - Integration test gates:
runtime_uring.rs,bitrate_caps.rs'sDial::Real/mod uring(and itsmodgate inmain.rs), and the io_uring cases inembed,handoff,peer_limits,refusals,tenant_matrix, andwire_statsmoved fromtarget_os = "linux"tocfg(uring).
Every remaining moq_uring and crate::runtime_uring reference under tests/ now sits behind uring. The leftover config.runtime.io_uring = true lines are inside shared helpers that take a backend flag. They only set a config field, and the Tokio callers pass false, so they build on armv7.
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 2f5c323c979a685fc3047c23e086f4f12c432c9b
The follow-up closes the test-build gap: rs/moq-relay/Cargo.toml and the generated Nix graph gate the moq-uring dev-dependency on the same architectures as production, and io_uring integration cases now use cfg(uring). Generic Linux handoff tests retain their socket dependency and Tokio coverage. No new actionable issue found by inspection. I did not cross-compile; an armv7 test build, not just the release binary, is the useful regression check for this change.

Problem
Nightly's
moq-cli / release / Build (armv7-unknown-linux-gnueabihf)fails (job):io-uring'scompile_error!refuses its prebuiltsys.rson 32-bit ARM. moq-relay now always depends onmoq-uringon Linux, and moq-cli embeds the relay, so every Linux target compiles io-uring, including ones it ships no bindings for.cargo install moq-relayormoq-clion a Raspberry Pi running 32-bit Linux (armhf, a documented platform) breaks the same way, so a repo-local.cargo/config.tomlcfg would only fix our release job.Approach
moq-relay builds its io_uring runtime only where io-uring has bindings: Linux on x86_64, aarch64, riscv64, loongarch64, or powerpc64.
moq-uringandweb-transport-protodependencies move under that target cfg.build.rssetscfg(uring)for the same targets. The relay's io_uring sites inrelay.rs,internal.rs,incoming.rs,lib.rs, andauth.rsmove fromtarget_os = "linux"touring. The handoff code stays Linux-wide.moq-uringdev-dependency moves to a table gated on the same architectures (socket2stays Linux-wide), and the io_uring-only integration tests (runtime_uring.rs,bitrate_caps.rs, and the io_uring cases inembed,handoff,peer_limits,refusals,tenant_matrix,wire_stats) switch fromtarget_os = "linux"touring, which the build script also sets for integration tests. Handoff and Tokio-worker tests stay Linux-wide.nix/Cargo.nixregenerated.runtime.io_uring = truerefuses at config check and names the supported architectures, as it already did off Linux.Validation
cargo check --target armv7-unknown-linux-gnueabihf -p moq-uringhits the samecompile_error!.cargo check --target armv7-unknown-linux-gnueabihf -p moq-relay -p moq-cli --features moq-cli/v4l2(the release job's crate and features) passes with-D warnings, andcargo tree -i io-uringfor that target is empty.cargo check --target armv7-unknown-linux-gnueabihf -p moq-relay --all-targetswith-D warningspasses, with and without--features test-support. Before the test-side change, the same command fails on io-uring'scompile_error!.cargo tree --target armv7-unknown-linux-gnueabihf -p moq-relay -e normal,dev,build -i io-uringis empty.just checkpasses on x86_64 Linux, where every io_uring integration test still builds and runs.cargo clippy -p moq-relay --all-targets -D warningspasses on x86_64 Linux, with and withouttest-support.Impact
runtime.io_uring/--runtime-io-uringis unavailable on 32-bit and other Linux architectures io-uring has no bindings for. It was never in a release build for those targets: before feat(moq-tokio,moq-relay,qmux)!: always compile the network stack #8852 it was an opt-in feature. No API or wire change.Alternatives
--cfg io_uring_skip_arch_checkfor armv7. The skip is sound there: bindgen output for armv7 from the kernel headers is byte-identical to x86_64 and aarch64, including layout assertions and syscall numbers (425–427 on ARM EABI too). It would keep io_uring on armv7, but a repo-local cfg can't reachcargo installusers, and io_uring on a 32-bit relay has no consumer.bindgenfeature on other architectures: this needs libclang and target kernel headers in every build.Caused by
moq-dev/moq#8852 made
moq-uringan unconditional Linux dependency of moq-relay.Decisions
cfg(uring)rather than leaving tests Linux-wide, socargo test -p moq-relayworks where the release build already does.Follow-ups
just checkrun, moq-cliargs::tests::the_environment_cannot_ask_for_a_moq_sideandthe_released_name_and_verb_spellings_are_refusedtimed out at 60s; alone they pass in ~12 ms. Unrelated to this change (pure argument parsing); worth a flake quest if it recurs.Models
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 2f5c323
Base: origin/main at 0edf6e2
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:
01a1e9b5-4198-7983-bceb-3b82551fc11e, round 1Score: 9/10,
The architecture gating is coherent and narrowly scoped, with no actionable regressions found, but builds and tests remain unvalidated as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none