Repository navigation
build(properties-view): state the conversion groups PRIVATE on the compiled TU (#3164) - #3224
Conversation
zackees
left a comment
There was a problem hiding this comment.
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.
99712f6 to
8f4dd9b
Compare
|
Qt Frontend lane diagnosis (run 41226300142, job 124611293367) — the link failed, not the compile:
Fix in 8f4dd9b: The 17:39 run on 9dbe166 was green because that push did not select the |
…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.
8f4dd9b to
97481b9
Compare
…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.
|
Heads-up on the branch history: the fix was rebased onto the |
Fixes #3164.
What
OBS::properties-viewstated the three conversion groups as INTERFACE options. CMakeappends a linked target's INTERFACE options after the consumer's own, so the frontend —
which still holds the global
-Wno-conversion/-Wno-float-conversionpins — could notpin them back off. Under a distribution Qt 6.8 that turned two
long doublecalls toQString::arg()into errors (-Wfloat-conversion,-Werror) while CI, on Qt 6.11'stemplate
arg(T, ...), stayed green. #3096 fixed the Apple half of the same leak byexcluding 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 ownOBJECTlibrary,
properties-view-code, which states the groupsPRIVATE. The interface targetcarries 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 ofthe 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
OBSBasicStatscall sites (the issue's option 2) todouble, so thefile is clean under Qt 6.8's only floating-point overload once the app target opts in. A
byte count is exact in a
doubleup to 2^53; the displayed value is unchanged.RED
ci/test_frontend_conversion_optins.pygains a repo-wide check that notarget_compile_options(<t> INTERFACE ...)names a positive conversion group.The same leak measured in a build tree, rather than argued from the text: a fresh
-DENABLE_FRONTEND=ONconfigure of master, counting theobs-studiotarget's own TUs whosecommand line carries a positive group (
ninja -t commands obs-studio | grep CMakeFiles/obs-studio.dir/):6fdc264bf63 is the same number
frontend/CMakeLists.txtgives for the files still unconverted, whichis what the pins were holding; the app now keeps only its single
-Wsign-conversionopt-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 listsshared/properties-view, so a PR touching these sourcesstill selects the sanitizer lane, and
repo_interface_darwin_violations()is still empty.cmake -S . -B buildreconfigures;properties-view-codecompiles the unity TU with thethree groups and no diagnostics, and
decklink-output-uirebuilds and links against theshared 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.