Skip to content

clang-tidy-diff still analyses the runner's Catch2, not one the repository pins (#666's first closing condition) #674

Description

@Yaraslaut

PR #673 closes #666 by its second closing condition — the clang-tidy-diff job
now asserts the Catch2 it analyses against (scripts/check_catch2_pin.sh . --strict), and a workstation run of the same script prints the divergence
instead of staying silent. That makes the divergence loud. It does not remove
it.

#666's first closing condition is the stronger one and is still open:

Close it if the job stops depending on the runner's Catch2 — e.g. the
clang-tidy job builds Catch2 from the version CMakeLists.txt already pins
for FetchContent (v3.8.1) rather than apt-get install catch2, so local and
CI analyse the same expansion.

If the job analysed a Catch2 the repository pins, a local run of the job's own
configure would analyse the same headers, and there would be nothing for a gate
to report. The gate in #673 is the second-best outcome: it tells you the two
measurements differ, it cannot make them agree.

What it would take

Removing catch2 from the clang-tidy job's apt-get install line is not
sufficient on its own, for two reasons:

  1. A workstation with a system Catch2 still diverges. CMakeLists.txt:560
    is find_package(Catch2 CONFIG QUIET) with the FetchContent v3.8.1
    fallback only on NOT Catch2_FOUND. A contributor with a distribution
    Catch2 (3.16.0 here) would keep getting theirs. Forcing the pinned one needs
    something like CMAKE_DISABLE_FIND_PACKAGE_Catch2=ON in that job's
    configure, or a morph-level option.
  2. examples/common/CMakeLists.txt calls find_package(Catch2 3 CONFIG QUIET) and treats "not found" as a hard FATAL_ERROR, relying on the
    Tests section's FetchContent having already resolved one
    (CMakeLists.txt:618-627). Whether that second find_package still
    succeeds under CMAKE_DISABLE_FIND_PACKAGE_Catch2=ON — FetchContent's
    CMAKE_FIND_PACKAGE_REDIRECTS_DIR config would normally satisfy it, and
    CMAKE_DISABLE_FIND_PACKAGE_<Pkg> would normally block even that — is the
    question that decides whether this is a one-line change or a restructuring.

The clang-tidy job turns MORPH_BUILD_LADDER on, so it goes through that
examples/common path.

Verification status

What would change the verdict

  • Close as fixed when the clang-tidy-diff job's compile database resolves
    Catch2 to a version this repository pins, demonstrated by
    scripts/check_catch2_pin.sh finding the pinned version rather than apt's —
    and by a local run of the job's configure producing the same version on a
    machine that has a different distribution Catch2 installed.
  • Close as invalid if the configure turns out not to be able to reach that
    state without the ladder losing its Catch2, in which case the finding is that
    the ladder's find_package coupling is the blocker and that is the better
    ticket.
  • Reduce in scope if the divergence turns out not to be version-driven at
    all — clang-tidy-diff run locally is silently blind to Catch2 TEST_CASE cognitive-complexity findings the CI job reports #666 notes its own evidence (3.5.3 headers ahead on -isystem restore
    CI's behaviour) is consistent with a path-ordering explanation it did not
    exclude.

Found while closing #666 in PR #673; filed rather than folded in, per AGENTS.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VptDWG2fKr2vBnLSJcgzgW

Activity

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

    area: ciSubsystem: cienhancementNew feature or requesttriage: validWell-framed; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions