Repository navigation
build(frontend-tools): ratchet the target onto the conversion groups (#2625) - #2959
Conversation
zackees
left a comment
There was a problem hiding this comment.
Reviewed at 6289c58 (build(frontend-tools): ratchet the target onto the conversion groups (#2625)).
Verdict: correct, mechanical, and safe to land.
What I checked:
- Every stated conversion matches the compiler's existing behaviour.
switches.erase(switches.begin() + static_cast<std::ptrdiff_t>(i--))states the size_t → difference_type conversion the iterator offset already performed, and the post-decrement still handserasethe pre-decrement index, so the pruning loop is unchanged. The twostatic_cast<int>(obs_data_get_int(...))families (SwitchData::interval,QSpinBox::setValue) state the narrowing the assignment already did;intervalis declaredintandsetValuetakesint, so no range behaviour is introduced that master did not already have. - Nothing is disabled. No
-Wno-*is added; the target only names the three positive groups inside the existingCOMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNUguard, so MSVC and the Objective-C++ AppleClang block are untouched as the description says. - The ratchet claim holds without a list edit.
ci/conversion_ratchet.pyderivesratcheted_dirsfrom the tree'starget_compile_options()bodies rather than a hand-kept list, so naming the group inplugins/frontend-tools/CMakeLists.txtis what adds the target (the PR diff accordingly touches only the CMakeLists and the two sources).ci/test_conversion_ratchet.pystays green. - No ledger line needed. Pure flag-list and cast changes, no user-visible behaviour, so
docs/features.mdis correctly untouched.
Open item for CI, not for the author: the objective-C++ (auto-scene-switcher-osx.mm.hpp) half is unverified locally as stated in the description; the in-flight Sanitize 🧪 / asan job plus the macOS lane cover it. I am not queueing until those are green.
RED: with the three groups named on the target the pins stop hiding them, and a replay of the two C++ translation units this lane compiles reports eight sites: plugins/frontend-tools/auto-scene-switcher.cpp.hpp:41 -Wsign-conversion plugins/frontend-tools/auto-scene-switcher.cpp.hpp:354 -Wconversion plugins/frontend-tools/output-timer.cpp.hpp:259-265 -Wconversion (x6) The GREEN commit states those conversions at the call sites.
GREEN: the eight sites from the RED commit now name the conversion the compiler already performs, with no value change. auto-scene-switcher.cpp.hpp:41 size_t -> difference_type, at the iterator offset auto-scene-switcher.cpp.hpp:354 int64 -> the switcher's int interval output-timer.cpp.hpp:255-260 int64 -> the spin boxes' int value (x6) The replay that reported the eight findings now reports none for the three C++ units the target compiles on Linux, and the same three units compile with the three groups and -Werror kept.
6289c58 to
c84d535
Compare
|
Rebased onto master (
Squash-merge queued with auto-merge. The local gate stamp was not re-run on the rebased commit: it is a comments+flag-list diff, the pre-rebase Fast Gate was green, and the merge queue reruns the full lane set on the merge result. CI Gate on the queue decides. Handed off to the coordinator. |
|
Handed off to the coordinator. What CI proved on
Local evidence (in the PR body): a frontend-ON tree in the validate image replays the target's 2 C++ units as 8 findings before the fixes and 0 after, and the 3 units plus pch/moc compile with the groups and No local-gate stamp exists on HEAD — PR CI is the gate for this PR and it already ran the lanes this change selects; I did not stamp so the merge queue can rerun CI on the merge result. Rebase before stamping if you want one. |
|
Handed off to the coordinator. State after the rebase onto The rebase dropped the local-gate stamp on If a real failure comes back, comment here and I take it before the next issue. |
#2625, #2938) master's app builds fail in `plugins/frontend-tools/scripts.cpp.hpp`, the target #2959 ratcheted onto the conversion groups without replaying this unity TU: Ubuntu (gcc): 174: int64_t -> int [-Werror=conversion] 204: size_t -> difference_type [-Werror=sign-conversion] macOS (AppleClang): 204: size_t -> difference_type [-Werror,-Wsign-conversion] Both name the conversion the compiler already performs: `static_cast<int>` on the config row (the same cast #2959 used for the switcher's interval) and `static_cast<std::ptrdiff_t>` at the iterator offset (the idiom `auto-scene-switcher.cpp.hpp:41` already uses in this target). Refs #2625, Refs #2938.
…-rust#2956) (obs-rust#2961) * test: a ratchet opt-in PR selects the sanitizer lane (obs-rust#2960) RED on master: `hit()` matches only source suffixes, so the PR whose only change is the CMakeLists that turns a target's ratchet on selects no asan pass. That is obs-rust#2956's shape (one CMakeLists, +9 -0, `Sanitize` skipped) and obs-rust#2959's. Fails now: AssertionError: False is not true test_the_cmake_lists_that_turns_the_ratchet_on_hits test_the_pr_that_turns_a_targets_ratchet_on_selects_the_sanitizer_lane * ci: the ratchet opt-in PR runs the sanitizer lane (obs-rust#2923, obs-rust#2956, obs-rust#2959) `conversion_ratchet.hit()` matches a ratcheted target's own CMakeLists.txt as well as the sources below it: the PR that names a group in that file changes a build input of the target, and it is the cheapest place to pay for a diagnostic only the asan configuration reports (the blind spot obs-rust#2923 exists for). The match is the exact directory, so a nested `frontend/build/CMakeLists.txt` is another target and a directory the ratchet does not name opts nothing in. The `pull_request` guard is unchanged, so a merge-queue run still keeps the path selection (obs-rust#2072, obs-rust#2593). GREEN: `test_conversion_ratchet` + `test_ci_scope`, 61 tests. Real tree, `repo_ratcheted_dirs`: `plugins/decklink-captions/CMakeLists.txt` [pull_request] asan=true, [merge_group] asan=false. Fixes obs-rust#2960
obs-rust#2625, obs-rust#2938) (obs-rust#2968) master's app builds fail in `plugins/frontend-tools/scripts.cpp.hpp`, the target obs-rust#2959 ratcheted onto the conversion groups without replaying this unity TU: Ubuntu (gcc): 174: int64_t -> int [-Werror=conversion] 204: size_t -> difference_type [-Werror=sign-conversion] macOS (AppleClang): 204: size_t -> difference_type [-Werror,-Wsign-conversion] Both name the conversion the compiler already performs: `static_cast<int>` on the config row (the same cast obs-rust#2959 used for the switcher's interval) and `static_cast<std::ptrdiff_t>` at the iterator offset (the idiom `auto-scene-switcher.cpp.hpp:41` already uses in this target). Refs obs-rust#2625, Refs obs-rust#2938.
What
plugins/frontend-toolsis the last C++ frontend-side target the conversion pins still hide, and it needs eight sites stated. This slice opts it into the three groups and fixes them.RED —
64b6c220a, the target names the groups:GREEN —
c84d535ab, each site names the conversion the compiler already performs; no value changes, no-Wno-*, nothing disabled:auto-scene-switcher.cpp.hpp:41size_tinto the vector iterator'sdifference_typestatic_cast<std::ptrdiff_t>(i--)at the offsetauto-scene-switcher.cpp.hpp:354int64_tinto the switcher'sint intervalstatic_cast<int>(obs_data_get_int(...))output-timer.cpp.hpp:259-265int64_tintoQSpinBox::setValue(int)static_cast<int>(obs_data_get_int(...))(x6)Evidence
Measured on the checkout's frontend-ON build tree (
cmake -DENABLE_FRONTEND=ON, the Tier 2 validate image), replaying every compile entry with the migration's own helper appended with the three groups and-fsyntax-only(-Werrorremoved to enumerate instead of stop):-Wconversion, 1-Wsign-conversion)The same three units then compile with the groups and
-Werrorkept — the pch unit and the moc compilation included — which is what the target's console does once the CMakeLists names the groups:ci/conversion_ratchet.pynow listsplugins/frontend-tools(24 targets before, 25 after) andci/test_conversion_ratchet.pyis green (6 tests), so a PR touching this target selects the sanitizer lane for its own diagnostic (#2923).Scope
auto-scene-switcher-osx.mm.hppand the.hunits are read — the ObjC++ file has no arithmetic to state — but only the Linux variants are compiled here, so the AppleClang half of the block is unverified locally; the nextverify_onlydispatch compiles it.COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU, so/W4(build(msvc): Raise /W3 to /W4 and delete the dead /WX link option #2626) owns them.docs/features.mdline.Refs #2625