Repository navigation
fix(libmoq): unbreak the Linux C link list, and make VAAPI opt-in - #2669
Conversation
`native-libs/linux.txt` feeds `Libs.private` in the generated `moq.pc` and `MOQ_NATIVE_LIBS` in the CMake package, so every C consumer of libmoq on Linux was forced to link `-lva -lva-drm`. Nothing in libmoq has needed them since moq-vaapi 0.0.3 (#2465), which dlopens libva and leaves no `NEEDED` entry behind: the entries were stale, not load-bearing. A host with libva-dev installed never noticed. One without it fails at link time, which is what the nightly interop run hits today: /usr/bin/ld: cannot find -lva: No such file or directory /usr/bin/ld: cannot find -lva-drm: No such file or directory The runners carry the runtime libva2 (an ffmpeg dependency) but no libva-dev, so there is no `libva.so` symlink for `-lva` to resolve, and the pkg-config and CMake C clients fail to build.
The VAAPI encode backend has never been validated on real hardware (see the module docs on `encode::backend::vaapi`), yet it was on by default in moq-video, moq-transcode, and moq-cli, and explicitly enabled in libmoq and moq-boy. Keep the feature, but let a consumer ask for it. The build cost is not the reason. moq-vaapi 0.0.3 dlopens libva and vendors the headers its bindgen reads, so an enabled-vaapi build needs no libva-dev, links on a libva-less builder, and starts on a libva-less host. The comments and docs that justified the feature by "it needs libva" were wrong on that point and now say what is actually true. Also drops libva from the dev shell, which was only there to run the backend nobody now builds by default.
2b5ca20 to
e64c44a
Compare
|
Warning Review limit reached
Next review available in: 38 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughVAAPI was removed from default feature sets in 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@doc/bin/cli.md`:
- Around line 243-247: Update the Linux capture dependency wording near the
no-default-features command to avoid claiming that all system library
dependencies are removed: clarify that it removes the default dependencies for
NVENC, VAAPI, libclang/V4L2, and PipeWire, while audio capture remains enabled
and still requires cpal’s ALSA system dependency.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a721a0fc-1229-4167-a914-0fd38cd8d834
📒 Files selected for processing (17)
Cargo.tomldoc/bin/cli.mddoc/lib/rs/crate/moq-video.mdflake.nixrs/CLAUDE.mdrs/justfilers/libmoq/Cargo.tomlrs/libmoq/native-libs/linux.txtrs/libmoq/src/video.rsrs/moq-boy/Cargo.tomlrs/moq-cli/Cargo.tomlrs/moq-ffi/Cargo.tomlrs/moq-transcode/Cargo.tomlrs/moq-video/Cargo.tomlrs/moq-video/DESIGN-native-codecs.mdrs/moq-video/src/encode/backend/vaapi.rstest/smoke/clients/c/subscribe.c
💤 Files with no reviewable changes (2)
- rs/libmoq/native-libs/linux.txt
- flake.nix
`--no-default-features` drops the NVENC / VAAPI / PipeWire system libraries, but `capture` still pulls libclang + the V4L2 headers for the camera and ALSA for the microphone, so "no system library dependency" was never true of that build.
libmoq no longer enables moq-video's `vaapi` feature, but two doc comments still advertise the backend. `libmoq::video`'s module doc claimed the FFI boundary runs "NVENC/VAAPI/NVDEC on Linux". The `moq_video_encoder_output::encoder` doc in the same file was already fixed; this is the other half. cbindgen emits item docs into moq.h but not `//!` module docs, so this one is rustdoc-only. `moq-ffi`'s `MoqVideoEncoderKind` called NVENC and VAAPI "a libmoq-only build option". NVENC/NVDEC still are; VAAPI is now opt-in everywhere, enabled by no shipped consumer. The conclusion (Linux here is software-only) is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
va/va-drmentries from libmoq's Linux link list, which currently break every C consumer on a host without libva-dev.moq-video,moq-transcode,moq-cli,libmoq, andmoq-boy, because the backend has never been validated on hardware.The link list is a real bug
rs/libmoq/native-libs/linux.txtfeedsLibs.privatein the generatedmoq.pcandMOQ_NATIVE_LIBSin the CMake package, so every C consumer of libmoq on Linux was forced to link-lva -lva-drm. Nothing has needed them since moq-vaapi 0.0.3 (#2465) switched to dlopen, which leaves noNEEDEDentry in the archive.A host with libva-dev installed never noticed. The nightly interop run does, since the runners carry the runtime
libva2(an ffmpeg dependency) but no libva-dev, so there is nolibva.sosymlink for-lvato resolve:That is the
c-pkgconfigandc-cmakeclients failing to build in https://github.com/moq-dev/smoke/actions/runs/30997849385. It is a separate commit here so it can be cherry-picked; smoke builds against the publishedlibmoq-v*tarball, so the nightly stays red until libmoq is released with this in it.Why VAAPI goes opt-in
Not the dependency: moq-vaapi 0.0.3 dlopens libva and vendors the headers its bindgen reads, so an enabled-vaapi build needs no libva-dev, links on a libva-less builder, and starts on a libva-less host, where backend selection falls back to the next encoder. The reason is that the encode path has never run on real hardware, as
encode::backend::vaapi's module docs have said since it landed. It stays a supported feature, just one a consumer asks for.The comments and docs that explained the feature by "it links / requires libva" were wrong on that point and now say what is actually true.
Public API changes
vaapiis no longer a default feature ofmoq-videoormoq-transcode. Cargo treats removing a default feature as breaking, andcargo-semver-checksdoes not detect it, so it wants a line in the changelog even though nothing in the API moved.Behavior changes
MOQ_VIDEO_ENCODER_KIND_NAMEDwith"vaapi") now returnsNoEncoder; the name is dropped from the header's example list.moq-cli'svaapifeature still exists and still composes withcapture/transcode, it just has to be named.Test plan
nix develop --command just fix/just checkjust rs cistill compiles the backend: its clippy / doc / nextest passes are--all-features, and VAAPI needs nothing from the dev shell to build.(Written by Opus 5)