Skip to content

build(properties-view): state the conversion groups PRIVATE on the compiled TU (#3164) - #3224

Merged
zackees merged 4 commits into
masterfrom
fix/3164-properties-view-interface-groups
Oct 31, 2026
Merged

zackees merged 4 commits into
masterfrom
fix/3164-properties-view-interface-groups

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

Fixes #3164.

What

OBS::properties-view stated the three conversion groups as INTERFACE options. CMake
appends a linked target's INTERFACE options after the consumer's own, so the frontend —
which still holds the global -Wno-conversion / -Wno-float-conversion pins — could not
pin them back off. Under a distribution Qt 6.8 that turned two long double calls to
QString::arg() into errors (-Wfloat-conversion, -Werror) while CI, on Qt 6.11's
template arg(T, ...), stayed green. #3096 fixed the Apple half of the same leak by
excluding Darwin from the call, which only moved it to the other platforms.

The unity TU (build/properties-view.core+.hpp.cpp) now compiles in its own OBJECT
library, properties-view-code, which states the groups PRIVATE. The interface target
carries the objects, the headers and the include dirs. The headers stay listed as INTERFACE
sources because Qt's AUTOMOC scans the consumer's listed files for Q_OBJECT; that part of
the build is unchanged. The Qt helper libraries are INTERFACE targets that carry their own
unity sources, so the object target takes the include dirs and definitions they publish
rather than linking them (linking them would compile those TUs a second time and the
consumer that compiles them itself would define the same symbols).

Also converts the two OBSBasicStats call sites (the issue's option 2) to double, so the
file is clean under Qt 6.8's only floating-point overload once the app target opts in. A
byte count is exact in a double up to 2^53; the displayed value is unchanged.

RED

ci/test_frontend_conversion_optins.py gains a repo-wide check that no
target_compile_options(<t> INTERFACE ...) names a positive conversion group.

FAIL: test_no_interface_target_states_a_conversion_group
AssertionError: Lists differ: ['shared/properties-view/CMakeLists.txt: properties-view'] != []

The same leak measured in a build tree, rather than argued from the text: a fresh
-DENABLE_FRONTEND=ON configure of master, counting the obs-studio target's own TUs whose
command line carries a positive group (ninja -t commands obs-studio | grep CMakeFiles/obs-studio.dir/):

tree app TUs with a positive conversion group
master 6fdc264bf 63
this branch 0

63 is the same number frontend/CMakeLists.txt gives for the files still unconverted, which
is what the pins were holding; the app now keeps only its single -Wsign-conversion opt-in.

GREEN

  • uv run --no-project python -m unittest test_frontend_conversion_optins test_conversion_ratchet
    (from ci/) — 19 tests, ok.
  • repo_ratcheted_dirs() still lists shared/properties-view, so a PR touching these sources
    still selects the sanitizer lane, and repo_interface_darwin_violations() is still empty.
  • cmake -S . -B build reconfigures; properties-view-code compiles the unity TU with the
    three groups and no diagnostics, and decklink-output-ui rebuilds and links against the
    shared object (one compile of that TU instead of one per consumer).
  • test_shared_qt_platform — ok (1 skipped).

The full Qt frontend is not built on this host (the checkout's warm tree is
ENABLE_FRONTEND=OFF); the app lane in PR CI / the daily beta is the check for that.

Features ledger

No user-visible change: same symbols, same display values, same warnings for the converted
sources.

@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.

Coordinator review: this matches the fix agreed on #3164 (option 1 plus option 2). The new LinkedInterfaceConversionGroupTest checks every tracked CMakeLists.txt, which closes the whole class rather than just properties-view, and it skips vendored deps/. Moving the group to a properties-view-code OBJECT library and making it PRIVATE is the right shape. One thing for the PR body: say whether the RED commit shows the new test failing on master's shared/properties-view/CMakeLists.txt. The issue asked for that as the RED evidence, since no CI lane builds against Qt 6.8. No blocking findings.

@zackees
zackees force-pushed the fix/3164-properties-view-interface-groups branch from 99712f6 to 8f4dd9b Compare October 31, 2026 18:04
@zackees

zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

Qt Frontend lane diagnosis (run 41226300142, job 124611293367) — the link failed, not the compile:

FAILED: frontend/obs
ld.bfd: frontend.settings+.hpp.cpp.o: undefined reference to
  `OBSPropertiesView::OBSPropertiesView(OBSRef<obs_data*, ...>, char const*, ...)'
ld.bfd: mocs_compilation.cpp.o: undefined reference to `OBSPropertiesView::RefreshProperties()'
collect2: error: ld returned 1 exit status

properties-view-code compiled (.../properties-view-code.dir/build/properties-view.core+.hpp.cpp.o), but that object is not on the frontend's link line: CMake does not forward an OBJECT library's objects through a target's INTERFACE_LINK_LIBRARIES, so frontend/cmake/ui-dialogs.cmake's target_link_libraries(obs-studio PRIVATE OBS::properties-view) linked nothing. A two-target probe on CMake 4.1.6 reproduces it (undefined reference until the object library is stated on the interface target).

Fix in 8f4dd9b: target_sources(properties-view INTERFACE $<TARGET_OBJECTS:properties-view-code>), plus a test pinning the line (ci/test_frontend_conversion_optins.py, 8 tests pass locally; gersemi --check clean).

The 17:39 run on 9dbe166 was green because that push did not select the Qt Frontend Linux lane — this is the first run where the lane actually built the restructured target.

…up (#3164)

CMake appends a linked target's INTERFACE options after the consumer's own, so
a consumer still holding the global pins cannot turn the group back off. #3096
excluded Darwin from that call and left the other platforms leaking; on Qt 6.8
the frontend then stopped on a long double passed to QString::arg() (#3164). The
group belongs to the target whose sources were converted, stated there PRIVATE.

RED: uv run --no-project python -m unittest ci.test_frontend_conversion_optins
fails with 'shared/properties-view/CMakeLists.txt: properties-view'.
…mpiled TU (#3164)

The groups were INTERFACE options, so CMake appended them after every consumer's
own options: the frontend still holds the global -Wno-conversion /
-Wno-float-conversion pins, and it could not pin them back off. That is why a
distro-Qt 6.8 build stopped on two `long double` calls to `QString::arg()` while
CI (Qt 6.11) stayed green (#3096 hit the Apple half of the same leak).

The unity TU now compiles in its own OBJECT library, `properties-view-code`,
which states the three groups PRIVATE; the INTERFACE target carries the objects,
the headers (AUTOMOC still scans them in the consumer, unchanged) and the
include dirs. The Qt helper libraries are INTERFACE targets that carry their own
unity sources, so the object target takes the include dirs and definitions they
publish instead of linking them, which would compile those TUs twice.

Measured in a fresh `ENABLE_FRONTEND=ON` configure: the app target's own TUs went
from 63 carrying a positive conversion group to 0 (only its single
-Wsign-conversion opt-in and the global pins remain), and
`repo_ratcheted_dirs()` still lists `shared/properties-view`, so the sanitizer
lane still selects on its sources.

Also converts the two OBSBasicStats call sites (issue option 2) so the file is
clean under Qt 6.8's `arg(double, ...)` once the app target opts in.

GREEN: uv run --no-project python -m unittest test_frontend_conversion_optins
test_conversion_ratchet (from ci/) -- 19 tests, ok. decklink-output-ui rebuilds
and links against the shared object.
The lint lane's gersemi check reformatted the new target block; no change to the
configured targets.
@zackees
zackees force-pushed the fix/3164-properties-view-interface-groups branch from 8f4dd9b to 97481b9 Compare October 31, 2026 18:19
@zackees
zackees enabled auto-merge October 31, 2026 18:19
…ace target (#3164)

The Qt Frontend lane failed to link `obs` after the CMake restructure:

    ld.bfd: frontend.settings+.hpp.cpp.o: undefined reference to
      `OBSPropertiesView::OBSPropertiesView(...)`
    ld.bfd: mocs_compilation.cpp.o: undefined reference to
      `OBSPropertiesView::RefreshProperties()`

CMake does not forward an OBJECT library's objects through
INTERFACE_LINK_LIBRARIES, so `frontend/cmake/ui-dialogs.cmake`'s
`target_link_libraries(obs-studio PRIVATE OBS::properties-view)` linked
nothing: the frontend's link line carried no
`properties-view-code.dir/...o` at all. A two-target probe on CMake 4.1.6
reproduces it (the executable links with the object library named only in
the interface target's INTERFACE_LINK_LIBRARIES).

`target_sources(properties-view INTERFACE $<TARGET_OBJECTS:properties-view-code>)`
states the objects on the interface target, where the consumer sees them;
the probe links and runs with that line added. A test pins the line so a
later cleanup of the link block does not drop it again.

Refs #3164.
@zackees

zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member Author

Heads-up on the branch history: the fix was rebased onto the 97481b9df tip (which had rewritten the branch without it) and force-pushed as 4ba293191. Anyone else rebasing this branch must keep 4ba293191's target_sources(properties-view INTERFACE $<TARGET_OBJECTS:properties-view-code>) line — without it obs links no OBSPropertiesView definitions and the Qt Frontend lane fails.

@zackees
zackees added this pull request to the merge queue Oct 31, 2026
Merged via the queue into master with commit 00e4e3b Oct 31, 2026
41 checks passed
@zackees
zackees deleted the fix/3164-properties-view-interface-groups branch October 31, 2026 19:27
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.

build(frontend): the app does not compile with Qt 6.8 since properties-view passes -Wfloat-conversion to its consumers (#3067)

1 participant