Repository navigation
build(frontend): keep the unconverted app target on the global conversion pins (#2938) - #2944
Conversation
The app target's conversion groups are opted into by naming them in target_compile_options. #2909 added a second block beside the existing sign-conversion opt-in with all three groups, while 63 frontend files were still unconverted, so the app lanes stopped on the first of them. The test fails on that shape: two blocks, and a set that is not the one group the target has ratcheted. It passes with the second block removed. RED: AssertionError: 2 != 1 (two opt-in blocks); the flag set is ['-Wconversion', '-Wfloat-conversion', '-Wsign-conversion'] instead of ['-Wsign-conversion'].
…sion pins (#2938) #2909 named all three conversion groups on `obs-studio` while 63 of its files were still unconverted, so `Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust)`, `Build 🧱 / Flatpak 📦` and both macOS app lanes stopped on the first of them. PR CI does not build the app, so the PR was green and master went red. This removes that second block. The target opts into `-Wsign-conversion` alone again — the group it had already converted — and `-Wconversion` / `-Wfloat-conversion` stay on the global pins until their files are converted. No behavior change: the removed flags only turned warnings into errors. GREEN: the new `ci/test_frontend_conversion_optins.py` passes (2 tests), and gersemi -c reports the file formatted.
zackees
left a comment
There was a problem hiding this comment.
Review: correct fix for the master red; evidence still running
Verdict: looks good — the two-block bug and its regression test both check out. I have not queued it yet: the Ubuntu/Flatpak app lanes that this PR exists for are still running in the Scheduled dispatch on the branch (40915924585), and the PR's check rollup also carries that run's CEF Chromium Support 🌐 failure, which is unrelated (see below).
What I verified locally
- RED: the new test fails on
origin/masterwith the shape the PR describes —AssertionError: 2 != 1 : one opt-in block per target…— and the surviving block names only-Wsign-conversion. - GREEN: on the PR head (
f67176296),uv run python -m unittest ci/test_frontend_conversion_optins.py→ 2 tests OK, anddiscover -s cifor that file → OK.ci/test_ci_scope.py(48) andci/test_local_gate.py(21) still pass, so the new file is picked up by the local gate'sci/test_*.pysweep and needs no lane-table row. - The test catches the regression: appending a second
target_compile_options(obs-studio …)block naming all three groups makes it fail with the intended message. The "one block per target" assertion is what would have stopped #2909. - No compiler behaviour change: the diff only removes the appended block and rewrites the comment; the first block's
-Wsign-conversionand the three global pins incmake/linux/compilerconfig.cmakeare untouched. TheFormat 🔍 / checksjob passes on the head, so the CMake formatting is clean.
Two notes, neither blocking
target_compile_options()is matched withre.findall(r"target_compile_options\(([^)]*)\)", ...), so a future call whose arguments contain a)would be silently truncated rather than parsed. Fine for this file today; worth a comment if the helper grows.test_global_pins_are_still_in_placeasserts the set of-Wno-*conversionstrings in the Linux config equals exactly the three pins. That is the current state; if a target ever names a per-target-Wno-…conversionthere, the test needs to scope to the global block.
Why the rollup shows a failure
CEF Chromium Support 🌐 (run 40915924585) fails on the same head SHA, but it is the repo-wide CEF pin alert — "macos-arm64: CEF 7871 is older than Chrome's extended stable" — and it fails on master too (scheduled run 40825610950). It is tracked by #1864/#1092 and not caused by this diff. The rest of the dispatch's app lanes are still queued/running; once they finish I will queue the PR if they are green. Do not read that check as a verdict on this change.
|
Local: The |
Refs #2938 (the Ubuntu/Flatpak half of the master red; macOS has its own cause, see #2940).
RED (how it fails)
ci/test_frontend_conversion_optins.pyon master'sfrontend/CMakeLists.txt:and, once past the count, the flags the
obs-studiotarget names are['-Wconversion', '-Wfloat-conversion', '-Wsign-conversion']instead of['-Wsign-conversion'].Root cause
frontend/CMakeLists.txtalready carried the ratchet opt-in:#2909 (
18f8a3f22) appended a second block at the end of the file naming allthree groups, while its own commit message said 746 diagnostics in 63 files were
still unconverted. The app lanes compile the frontend with
CMAKE_COMPILE_WARNING_AS_ERROR=ON, so they stopped on the first unconverted file:PR CI does select
Build 🧱 / Qt Frontend Linux 🐧forfrontend/changes, andthat job was green on #2909 — the app configure compiles a larger unity set than the
Qt-only lane, so it never saw the file.
Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust)andBuild 🧱 / Flatpak 📦are the lanes that break, and neither runs on a PR.GREEN (what this changes)
frontend/CMakeLists.txt: the second block is gone. The target opts into-Wsign-conversionalone again (the group it has converted), and-Wconversion/-Wfloat-conversionstay on the global pins incmake/linux/compilerconfig.cmakeuntil their files are converted. The commentnow says so, and says why a second block is the failure mode.
ci/test_frontend_conversion_optins.py(new): one conversion opt-in block pertarget, naming exactly the group the target has ratcheted, with the three global
pins still in place. Adding a group to the block is a two-line test change in the
PR that converts the target's last file; adding a second block fails.
No compiler behavior change: the removed flags only turned warnings into errors, and
the pins they fell back to are the ones every other target uses.
Local:
uv run python -m unittest ci/test_frontend_conversion_optins.py— 2 tests OK;./lint— ok (57.7 s);gersemi -c frontend/CMakeLists.txt— clean.The Ubuntu/Flatpak app lanes only run from
scheduled.yaml, so aworkflow_dispatchon this branch follows for the lane evidence; the remaining frontend conversion groups
(#2940's casts are the start) re-land the flag per group once the file set is clean.