Repository navigation
fix(ffmpeg-mux): state the five colour enum conversions AppleClang reports (#3089) - #3090
Merged
Merged
Conversation
…ports (#3089) #3068 ratcheted obs-ffmpeg-mux onto -Wconversion/-Wsign-conversion and replayed both unity TUs with gcc-toolset-14, where these five sites are silent. AppleClang gives int -> enum conversions the enum's underlying type, which is unsigned int for every AVColor* enum, so the macOS app build fails on them and the daily beta has been red since #3068 landed (run 41083530569, job 124158735150). The fields arrive as the int the command line carries; the cast states the conversion the code already performed. No behaviour change. RED (local, clang 21, ffmpeg 8 headers, -Werror): ffmpeg-mux.core+.h.c: 5 errors, lines 440-444 GREEN: both unity TUs, clang and gcc, 0 diagnostics. Refs #2625, #3068
zackees
commented
Oct 30, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
Coordinator review: correct. Explicit enum casts preserve upstream's implicit conversion (same width), so behaviour is unchanged and it clears AppleClang's -Wconversion. It's a build fix, so no ledger line is needed.
zackees
enabled auto-merge
October 30, 2026 18:08
This was referenced Oct 31, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 31, 2026
…bs-rust#3119) The ratchet is checked by whatever last compiled the target, and every Linux configuration here is gcc. gcc has no -Wimplicit-int-conversion and no -Wimplicit-int-conversion-on-negation and a narrower -Wsign-conversion set, so a target can pass its gcc replay and still fail the nightly's AppleClang app build — which is how obs-rust#3084 and obs-rust#3090 escaped in two days. `ci/conversion_clang_replay.py` replays a configured tree's unity groups with `clang -fsyntax-only` and the conversion group, taking each group's own flags from `compile_commands.json`: the global `-Wno-conversion` pins come out, the target's other pins and includes stay, `-Werror` comes out so every site is reported rather than the first, and nothing is written or linked. Coverage is the ratchet's own list (`conversion_ratchet.ratcheted_dirs()`), never a copy, so the PR that opts a target in is covered without touching this file. Three silent-pass paths are closed by the tool itself, each with a test: a ratcheted directory the configuration compiled no group for is reported, a group that died before parsing (missing header) is reported instead of reading as clean, and a finding inside a dependency header or a clang unused-command-line-argument artifact is not counted. Measured on this host, 73 unity groups out of a `build/` tree (clang 21.1.8, conversion pins removed): 6.0 s wall at 8 jobs, 34.6 s serially, slowest group 1.9 s. 69 of the 73 parse here; the other four need the va/X11 dev headers this Nix checkout does not carry, which is one more reason the replay belongs in the validate image rather than a bare runner. With the pins removed clang reports 7 sites in 4 directories that gcc reports as zero on the same TUs and flags — `libobs/obs-source-transition.c.h:836`, four in `plugins/obs-filters`, two in `plugins/linux-v4l2` and one in `plugins/linux-pipewire` — the obs-rust#2921/obs-rust#3090 shape (`long long`/`int` into an enum, `int` into an unsigned). Not wired into a lane yet, and no test or public header changed: this PR is the tool and its guard tests, so the lane step can be reviewed on its own (ci.toml allow entry, `uv run --no-project`, the setup-uv save-cache expression). Refs obs-rust#3118. Tests: `uv run python -m unittest ci/test_conversion_clang_replay.py`, 16 tests, 0.01 s, no compiler invoked and no own threads.
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 31, 2026
…lane (obs-rust#3118) (obs-rust#3120) * test(ci): pin the clang replay's lane verdict and compile database (obs-rust#3118) The replay tool landed in obs-rust#3119 with no caller. This adds the two pins the caller needs before it can be wired in: the verdict function behind the exit status (a finding and a group that did not parse are red, a ratcheted directory a lane tree does not build is not), and the compile database on the sanitizer configure line the replay reads. Red on master: ci/test_conversion_clang_replay.py cannot import exit_status and test_sanitize_harness' configure case reports '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' not found. * fix(libobs,plugins): state the conversions clang's ratchet reports (obs-rust#3118) Replaying this tree's unity groups with clang (obs-rust#3119) reports eight sites the gcc configuration does not, all in directories the ratchet already covers: libobs/obs-source-transition.c.h:836 size_t -> enum obs_transition_target plugins/obs-filters/hdr-tonemap-filter.c.h:72,82 plugins/obs-filters/sdr-on-hdr-filter.c.h:67,74 plugins/linux-v4l2/v4l2-busy.c.h:168 int -> uint32_t plugins/linux-v4l2/v4l2-input.c.h:150 int -> enum video_range_type plugins/linux-pipewire/camera-portal.c.h:1062 Each is the explicit conversion the compiler already performed implicitly, so no value changes and no warning is disabled. Two of the four directories (libobs, obs-filters) are compiled by the macOS app lane, so these were escapes waiting for the next nightly rather than Linux-only curiosities. Verify: uv run --no-project ci/conversion_clang_replay.py --compdb build/compile_commands.json before (8 findings, 4 groups) and after (0). * infra(ci): replay the conversion ratchet with clang in the sanitizer lane (obs-rust#3118) The ratchet is checked by whichever configuration compiles the target, and every Linux one of those is gcc; gcc has no -Wimplicit-int-conversion and a narrower -Wsign-conversion set, so a target can pass its own gcc replay and still fail the nightly's AppleClang app build (obs-rust#3084, obs-rust#3090, obs-rust#2921 in one week). The sanitizer asan job already builds the whole app on the PR that changes a ratcheted target (obs-rust#2923, ci/conversion_ratchet.py), so it is the lane that can afford a second compiler. Its configure line now exports compile_commands.json, and one step replays every unity group with clang -fsyntax-only plus the three conversion groups: 73 groups in ~7 s, no build and no link. --allow-uncovered exists because the sanitizer configuration deliberately turns vlc, vst, webrtc and the decklink plugins off: those ratcheted directories have no group in the tree and are reported, not failed. A real finding or a group that did not parse is still red. The strict default stays for a full app tree. * fix(ci): swap the compiler launcher as well as the compiler (obs-rust#3118) The sanitizer tree configures zccache as CMAKE_C_COMPILER_LAUNCHER, so its compile database entries read "zccache <compiler> <flags> …". Replacing only the first token handed clang the real compiler path as an input file, so the lane would have failed on every group. Drop the leading non-flag tokens and pin it with a case over a launched entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3089.
RED
The daily beta is red on macOS arm64/x86_64:
Release OBS-Studio-Rustrun 41083530569, jobBuild OBS-Studio-Rust 🧱(124158735150):#3068put this target on the conversion groups for #2625 and replayed the two unity TUs with gcc-toolset-14, where these five sites are silent. AppleClang derives the target type of anint→ enum conversion from the enum's underlying type, which isunsigned intfor everyAVColor*enum (no negative enumerators), so all five are-Wsign-conversionthere. PR CI builds no OBS app (ci_scope.py), so the macOS app build only appears in a release/schedule/dispatch.Reproduced locally without a macOS host, same file and flags (clang 21.1.8, ffmpeg 8 headers):
ffmpeg-mux.posix+.h.cand gcc on both TUs are clean, which is why #3068's replay passed.GREEN
Each of the five assignments states the conversion the code has always performed (
(enum AVColorPrimaries), …). The values are theintthe command line carries intostruct main_params; the enums are the same width, so this is spelling, not behaviour.After the change, with the target's own groups on and
-Werror:ffmpeg-mux.core+.h.cffmpeg-mux.posix+.h.c./lint— ok (56.2 s, includes clippy, Dylints, gersemi, clang-format).Acceptance
The macOS app build is the only lane that compiles the Qt/app target set. Verified locally for ffmpeg-mux; the release dispatch (
Release OBS-Studio-Rust) is the run that proves the whole app set and may surface the next unratcheted app-only TU —Release OBS-Studio-Rustwas also red on 2026-10-29 (40906899118) on four-Wconversiondiagnostics inmp4-mux.c.h, so the ratchet's AppleClang half is a wave.Refs #2625, #3068