Repository navigation
fix(frontend): keep the app target's Apple conversion pin through the interface group (#3096) - #3102
Conversation
…ator applies (#3096) The Darwin half of the app target's conversion genex does not reach macOS app TUs: master's release-gate macOS jobs stop in Qt 6.11's own headers (qversiontagging.h:80, qnamespace.h:1926/1930/1935) with -Werror,-Wsign-conversion even though frontend/CMakeLists.txt asks for the opposite. Assert the pin as an if(OS_MACOS) branch instead, which no generator can drop, and fail while the tree states it inside $<NOT:$<PLATFORM_ID:Darwin>>. Red: uv run python -m unittest ci/test_frontend_conversion_optins.py FAIL: test_darwin_pins_the_group_in_a_branch_the_xcode_generator_honours '$<NOT:$<PLATFORM_ID:Darwin>>' unexpectedly found
#3096) The macOS app lane builds with the Xcode generator, and a $<NOT:$<PLATFORM_ID:Darwin>> genex inside target_compile_options does not reach its TUs: master's release-gate macOS jobs stop in Qt 6.11's own headers (qversiontagging.h:80 "int to quintptr", qnamespace.h:1926/1930/1935) with -Werror,-Wsign-conversion although frontend/CMakeLists.txt asks for the opposite, so #2979's guard never took effect on that generator. State the two platforms as an if(OS_MACOS)/else branch: Apple gets the -Wno-sign-conversion pin as a real compile option, the other lanes keep the ratcheted group. Linux/Windows configure output is unchanged (checked on a scratch project: the flag is still in the non-Darwin FLAGS). Same lane, second diagnostic: frontend.widgets+.hpp.cpp stops on frontend/components/VolumeMeterSnapshot.hpp:32, "implicit conversion from 'uint64_t' to 'double' may lose precision" (-Wimplicit-int-float-conversion), which AppleClang reports by default. State the conversion at the call site. Green: uv run python -m unittest ci/test_frontend_conversion_optins.py (3 tests OK), ./lint ok (gersemi reformat of the new branch). Refs #3096
The target's conversion flags are INTERFACE, so they reach the app target's Apple TUs after the target's own -Wno-sign-conversion and re-enable the group inside Qt 6.11's headers. State the pin on an OS_MACOS branch, the shape the Xcode generator honours.
|
macOS lane acceptance passed on head |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: looks right. Replacing the $<NOT:$<PLATFORM_ID:Darwin>> genex with an if(OS_MACOS) branch is the plain way to make sure the Xcode generator applies the pin, and pinning properties-view's INTERFACE group the same way closes the leak into Apple consumers. The ratchet tests strip comments before matching, so a comment can't satisfy them, and they cover both targets. The real proof is the macOS app lane, which only runs on schedule or dispatch, so watch the next nightly.
The fix works, but the stated cause is not the mechanism — and that matters for the next ratchetThe macOS acceptance on 1. The nested Darwin genex does expand — in both generators. A scratch project with the exact shape The flags arrive, and the control probe's false branch leaves no 2. The mechanism is INTERFACE ordering, plus CMake appends a linked library's INTERFACE options after the consumer's own options and after the directory pins. From the same probe, with the app target also carrying a real and with clang, a preceding negative does not survive a later positive: That is the exact diagnostic text the macOS lane printed inside 3. Suggested edits (not blocking the merge of this PR's fix):
|
|
Closing the loop on the three corrections: #3106 has them.
|
…t#3096) (obs-rust#3106) * docs(ci): state the INTERFACE ordering as the cause, not the genex (obs-rust#3096) The removed comments claimed the Xcode generator does not apply the Darwin half of a `$<NOT:$<PLATFORM_ID:Darwin>>` genex. A scratch project with the same shape shows the genex expands in both generators, so that was never the mechanism: `OBS::properties-view` adds its groups as INTERFACE options, CMake appends them after the consumer's own, and `-Wconversion` re-enables `-Wsign-conversion` diagnostics. Only the INTERFACE block can fix it; the `if(OS_MACOS)` branch stays because it keeps the pin a visible compile option. No code change: comments, docstrings and one test name. * test(ci): pin Darwin out of every INTERFACE conversion group (obs-rust#3096) `target_compile_options(<t> INTERFACE -Wconversion ...)` is appended to every consumer's compile line after the consumer's own options, and `-Wconversion` re-enables `-Wsign-conversion` diagnostics, so a consumer-side `-Wno-sign-conversion` is not a pin. That is how the macOS app lane kept stopping inside Qt 6.11's headers after obs-rust#2979, and no PR lane builds the app, so the class has no CI oracle of its own. `interface_darwin_violations()` reads it from the tree: a positive group in an INTERFACE call must either exclude Darwin with a `$<NOT:$<PLATFORM_ID:Darwin>>` genex or sit in the `else()` branch of an `if(OS_MACOS)` block. Comments are stripped first, so a commented-out guard cannot satisfy the check. RED: on `91a9934ed^` the tree-level check reports `shared/properties-view/CMakeLists.txt: properties-view`, the file obs-rust#3102 fixed. GREEN: it reports nothing on this tree; the five fixture cases cover the bare group, both exempt shapes, a comment-only guard and a pinned call.
Refs #3096.
Root cause
The macOS app lane still stopped in Qt 6.11's own headers after the app target's
-Wno-sign-conversionpin. The pin was applied, butobs-studiolinksOBS::properties-view, whose conversion groups are INTERFACE options. Thoseland after the target's own options, so the interface's
-Wsign-conversionre-enabled the group inside
qversiontagging.h,qnamespace.h:1926/1930/1935.Evidence from the dispatched macOS run on the previous head (41119526629, job
124283138874), after the
if(OS_MACOS)pin infrontend/CMakeLists.txt:What
frontend/CMakeLists.txt— state the app target's Apple pin in anif(OS_MACOS)branch. The Xcode generator does not apply the Darwin half of a$<NOT:$<PLATFORM_ID:Darwin>>genex intarget_compile_options(build(frontend): keep the sign-conversion ratchet off the Darwin TUs (#2950) #2979), sothe earlier nested genex never reached the TUs.
shared/properties-view/CMakeLists.txt— the target is INTERFACE; state itsthree-group opt-in on the non-Apple branch and keep
-Wno-sign-conversiononOS_MACOS, so a consumer's own pin cannot be overridden by the linkedinterface. This is the interim shape build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625 already uses for the app target;
the Darwin hole is tracked by build: restore the frontend -Wsign-conversion ratchet on the Darwin TUs once the Qt 6.11 prefixes leave it (#2950, #2625) #2989.
frontend/components/VolumeMeterSnapshot.hpp:32— state theuint64_t -> doublenanosecond delta conversion that AppleClang reports with-Wimplicit-int-float-conversion.RED/GREEN
RED
36293c4f4— the extendedci/test_frontend_conversion_optins.pyfails onthe previous tree (
darwin_branchisNone, and properties-view has noOS_MACOSbranch). GREEN494781525— 5 tests pass;uvx gersemi --checkonthe changed CMakeLists is clean;
./lintis ok.The macOS lane itself is the acceptance: a dispatched
scheduled.yamlrun onthis head must compile
frontend.sparkle+.hpp.cppand the Qt 6.11 headerswithout
-Werror,-Wsign-conversion.No
docs/features.mdline: no user-visible behaviour changes.Test cost: no new Rust tests; the added checks are sub-millisecond text assertions.