Skip to content

build(frontend): keep the unconverted app target on the global conversion pins (#2938) - #2944

Merged
zackees merged 2 commits into
masterfrom
fix/2938-frontend-conversion-flags
Oct 29, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/2938-frontend-conversion-flags

Conversation

@zackees

@zackees zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member

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.py on master's frontend/CMakeLists.txt:

AssertionError: 2 != 1 : one opt-in block per target: a second block silently
widens the groups the target opts into (#2909, #2938)

and, once past the count, the flags the obs-studio target names are
['-Wconversion', '-Wfloat-conversion', '-Wsign-conversion'] instead of
['-Wsign-conversion'].

Root cause

frontend/CMakeLists.txt already carried the ratchet opt-in:

# ...it opts into that group alone. -Wconversion and -Wfloat-conversion keep the
# global pins for now...
target_compile_options(obs-studio PRIVATE "...:-Wsign-conversion>")

#2909 (18f8a3f22) appended a second block at the end of the file naming all
three 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:

frontend/utility/ExtraBrowsersModel.cpp.hpp:20:34: error: conversion from 'qsizetype' ... [-Werror=conversion]

PR CI does select Build 🧱 / Qt Frontend Linux 🐧 for frontend/ changes, and
that 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) and
Build 🧱 / 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-conversion alone again (the group it has converted), and
    -Wconversion / -Wfloat-conversion stay on the global pins in
    cmake/linux/compilerconfig.cmake until their files are converted. The comment
    now says so, and says why a second block is the failure mode.
  • ci/test_frontend_conversion_optins.py (new): one conversion opt-in block per
    target, 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 a workflow_dispatch
on 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.

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 zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/master with 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, and discover -s ci for that file → OK. ci/test_ci_scope.py (48) and ci/test_local_gate.py (21) still pass, so the new file is picked up by the local gate's ci/test_*.py sweep 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-conversion and the three global pins in cmake/linux/compilerconfig.cmake are untouched. The Format 🔍 / checks job passes on the head, so the CMake formatting is clean.

Two notes, neither blocking

  1. target_compile_options() is matched with re.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.
  2. test_global_pins_are_still_in_place asserts the set of -Wno-*conversion strings in the Linux config equals exactly the three pins. That is the current state; if a target ever names a per-target -Wno-…conversion there, 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.

@zackees

zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Local: ./lint ok, gersemi -c frontend/CMakeLists.txt clean, uv run python -m unittest ci/test_frontend_conversion_optins.py 2 tests OK. PR CI so far: Fast Gate, Qt Frontend Linux (6m36s — the CMake change configures and builds), CI Mode, Format, Event Data, Validate Data all pass; Rust Tier 2 Linux still pending.

The scheduled.yaml dispatch that produces the Ubuntu/Flatpak app-lane proof is queued behind the fleet's other dispatched runs (runner saturation, not a failure); I will attach its job conclusions when it starts. No local-gate stamp on this PR: the local cmocka suite is still running in this checkout's Tier 2 lane, so this is not a handoff yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant