Skip to content

test(ci): pin Darwin out of every INTERFACE conversion group (#3096) - #3106

Merged
zackees merged 2 commits into
masterfrom
infra/3096-conversion-pin-comments
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/3096-conversion-pin-comments

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

Follow-up to #3102 (merged as 91a9934ed), from the review on that PR.

What changed

  1. Comments and docstrings corrected. fix(frontend): keep the app target's Apple conversion pin through the interface group (#3096) #3102's comments asserted that the
    Xcode generator does not apply the Darwin half of a
    $<NOT:$<PLATFORM_ID:Darwin>> genex in target_compile_options. A scratch
    project 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-view adds its groups as INTERFACE options, CMake
    appends them after the consumer's own options, and -Wconversion re-enables
    -Wsign-conversion diagnostics regardless of an earlier
    -Wno-sign-conversion. The if(OS_MACOS) branch stays as the shape — it
    keeps the pin a visible compile option instead of an expression whose
    contribution depends on where a linked interface sorts.
  2. The class-wide check the review offered (ci/test_conversion_ratchet.py):
    every target_compile_options(<t> INTERFACE ...) that names a positive
    conversion group must exclude Darwin, either in the call
    ($<NOT:$<PLATFORM_ID:Darwin>>) or by sitting in the else() branch of an
    if(OS_MACOS) block. Comments are stripped before the scan, so a
    commented-out guard cannot satisfy it.

RED / GREEN

RED — on the pre-#3102 tree (91a9934ed^) the tree-level check reports:

shared/properties-view/CMakeLists.txt: properties-view

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. ./lint is ok and uvx ruff check/format --check
are clean.

No docs/features.md line: no user-visible behaviour change, test and comment
text only.

Test cost: no new Rust tests; the added checks are sub-millisecond text scans
(repo scan reads the tracked CMakeLists once).

Refs #3096.

…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 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: 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.

@zackees
zackees enabled auto-merge October 30, 2026 22:43
@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

  • Local: ./lint ok (131 s) and uvx ruff check/format --check clean; uv run --no-project python -m unittest test_conversion_ratchet 12/12.
  • RED evidence is in the commit: interface_darwin_violations() reports shared/properties-view/CMakeLists.txt: properties-view on 91a9934ed^ and nothing on this tree.
  • PR CI: Fast Gate, Rust Tier 2 Linux (build/tests OFF/tests ON, serial halves), Qt Frontend Linux and CI Mode pass; Sanitize / asan still running (no local stamp — comment/test-only change, and the tree scan reads the checkout, so the verdict is CI's).
  • No docs/features.md line and no Rust test cost: test and comment text only.

Auto-merge is on; the PR is a merge-queue landing once the sanitizer lane finishes.

@zackees
zackees added this pull request to the merge queue Oct 30, 2026
Merged via the queue into master with commit 72eca93 Oct 30, 2026
42 checks passed
@zackees
zackees deleted the infra/3096-conversion-pin-comments branch October 30, 2026 23:25
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Oct 31, 2026
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