Repository navigation
test(ci): pin Darwin out of every INTERFACE conversion group (#3096) - #3106
Conversation
…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.
`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 #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 #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.
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: one issue before this goes in.
interface_darwin_violations treats a $<NOT:$<PLATFORM_ID:Darwin>> genex in the INTERFACE body as an exemption (if not groups(body) or DARWIN_GUARD in body: continue), and test_either_darwin_exclusion_clears_the_violation pins that. #3102's own rationale (and the frontend test it added) is that the Xcode generator does not apply the Darwin half of that genex, which is how #2979's wrapped group still reached Qt 6.11's headers on the macOS lane. So the ratchet would accept the shape that broke the lane. I'd make only the if(OS_MACOS)/else() branch exempt, and assert that the genex form is a violation.
Minor: DARWIN_BRANCH matches only unindented if(OS_MACOS)/else()/endif() lines, so a nested block is reported as a violation. That's the safe direction, but a sentence saying so would help.
The rest (comment stripping, the INTERFACE call regex, both targets covered) looks good. I haven't queued it.
|
Handed off to the coordinator.
Auto-merge is on; the PR is a merge-queue landing once the sanitizer lane finishes. |
Follow-up to #3102 (merged as
91a9934ed), from the review on that PR.What changed
Xcode generator does not apply the Darwin half of a
$<NOT:$<PLATFORM_ID:Darwin>>genex intarget_compile_options. A scratchproject with that exact shape expands it in both the Ninja and Xcode
generators, so that was never the mechanism. The text now states the real
one:
OBS::properties-viewadds its groups as INTERFACE options, CMakeappends them after the consumer's own options, and
-Wconversionre-enables-Wsign-conversiondiagnostics regardless of an earlier-Wno-sign-conversion. Theif(OS_MACOS)branch stays as the shape — itkeeps the pin a visible compile option instead of an expression whose
contribution depends on where a linked interface sorts.
ci/test_conversion_ratchet.py):every
target_compile_options(<t> INTERFACE ...)that names a positiveconversion group must exclude Darwin, either in the call
(
$<NOT:$<PLATFORM_ID:Darwin>>) or by sitting in theelse()branch of anif(OS_MACOS)block. Comments are stripped before the scan, so acommented-out guard cannot satisfy it.
RED / GREEN
RED — on the pre-#3102 tree (
91a9934ed^) the tree-level check reports:which is the file #3102 fixed. GREEN — this tree reports nothing; the fixture
cases cover the bare group, both exempt shapes, a comment-only guard and a
pinned (non-group) call.
./lintis ok anduvx ruff check/format --checkare clean.
No
docs/features.mdline: no user-visible behaviour change, test and commenttext only.
Test cost: no new Rust tests; the added checks are sub-millisecond text scans
(repo scan reads the tracked CMakeLists once).
Refs #3096.