Skip to content

facade: frontend CMake (CMakeLists.txt, cmake/*.cmake): move 5 platform if-chains (12 branches) into per-platform cmake files #889

Closed

Description

@zackees

Part of #847.

Inventory of platform conditionals in frontend CMake (CMakeLists.txt, cmake/*.cmake) measured on origin/master. Total: 5.

Conditionals

File Line Macro What the branch does
CMakeLists.txt 112 OS_WINDOWS / OS_MACOS / OS_LINUX / OS_FREEBSD or OS_OPENBSD if/elseif chain selecting platform sources (4 branches)
cmake/feature-plugin-manager.cmake 23 OS_WINDOWS / OS_MACOS / OS_LINUX / OS_FREEBSD or OS_OPENBSD chain selecting plugin-manager platform sources (4 branches)
cmake/feature-whatsnew.cmake 6 OS_MACOS / OS_LINUX select whatsnew platform data (2 branches)
cmake/ui-qt.cmake 5 OS_MACOS (Qt 6.11 range) macOS-only Qt workaround
cmake/ui-qt.cmake 10 OS_LINUX or OS_FREEBSD or OS_OPENBSD Linux/BSD Qt platform dependencies

Proposed change

Facade function Implementation
Per-platform cmake files cmake/os-windows.cmake, cmake/os-macos.cmake, cmake/os-linux.cmake (names match the platform-path rule), each holding that platform's sources, defines and link deps only a single include(cmake/os-<platform>.cmake) dispatch stays in CMakeLists.txt

Likely must stay / caveats

  • The one dispatch line is unavoidable. Counts: 5 if chains (12 branches) in 4 files.

Test approach

No unit test possible; verified by the existing native CI builds (ci-full) on all three OS, plus checking that ci/ci_scope.py classifies the new files per platform.

RED first (failing characterisation test or facade stub), then GREEN, per docs/rust-port/testing-policy.md. Add the ci-full label since this touches shared frontend code built natively on all platforms.

Done when the listed files have no platform conditionals other than the documented exceptions, and the ratchet baseline (#848) is lowered accordingly.

Activity

  1. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Claiming: #889, frontend CMake platform facade.

    1. Add RED checks for the listed CMake boundaries and path-based platform classification, plus configure-time characterization of Qt/plugin-manager/WhatsNew selection.
    2. Keep one platform include dispatch. The selected per-OS file will define setup macros, called at the existing feature/source stages so order and variable scope stay the same. Preserve Linux/Flatpak/BSD distinctions and the Qt 6.11-only macOS workaround.
    3. Validate focused checks and full native Linux/Windows/macOS builds before merging one PR.

    The current ratchet baseline covers C/C++ source, not CMake, so there are no CMake entries to lower in that JSON; the new focused boundary guard will enforce the equivalent zero-host-branch contract for the three shared feature files while allowing the single CMakeLists dispatch. No unrelated C/C++ baseline entries will be removed. Existing native os-*.cmake files remain the host boundary; no new workflow is needed. Full native builds use dispatch because the old ci-full label no longer changes scope.

    First PR expected today. One issue at a time in the existing checkout; no Git worktree.

  2. added
    claimed
    on Oct 21, 2026
  3. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Releasing #889 temporarily; draft #1584 and branch infra/889-frontend-cmake-platform retain the completed facade work.

    PR CI 39524528252 passed and the macOS x86_64 app build passed. Full validation 39524526040 was canceled after Windows Tier 2 job 118977902779 failed linking the newly added output-delay test: unresolved cm_print_error in check_delivered. This is the already reported master blocker #1580, not a frontend CMake configure error. The raw failed build log is preserved locally; no crash stack exists because linking failed before tests ran.

    I will handle #1580 as the one active issue first, then reclaim #889 and complete the required native validation. No checks are bypassed and the PR remains draft.

  4. removed
    claimed
    on Oct 21, 2026
  5. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Claiming: resuming #889 and existing draft #1584 now that prerequisite #1580 is fixed and merged in #1591.

    1. Rebase the saved facade branch onto current master to include the diagnostic link fix and current CI policy.
    2. Rerun the focused configure/scope/build-group checks and dispatch native full validation on the rebased exact head.
    3. Finish PR CI and the normal merge queue, then close out this issue. Existing facade design and coverage stay in scope; no new workflow or Git worktree.
  6. added
    claimed
    on Oct 21, 2026
  7. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Completed in #1584 (merge 5ab6e96). The shared frontend CMake files now invoke five operations defined in the existing per-OS files, preserving setup order and caller scope. One include dispatch remains.

    Evidence: RED c362372 reproduces four boundary failures; GREEN 48a4436 passes all 86 focused checks and 17 configure scenarios. Full native validation 39529561107 passed all Windows/macOS/Linux app builds, Qt, native Rust/Tier 2 and Flatpak. PR CI 39529557057 and merge-group CI 39531175823 passed. No remaining work for this issue. The C/C++ platform ratchet has no CMake entries; the new focused guard covers the shared CMake boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions