Skip to content

bug: build: the macOS Tier 2 lane fails on master with -Wcomma in test/cmocka/test_module_load_steps.c #2842

Closed

Description

@zackees

Location

test/cmocka/test_module_load_steps.c:65-67 (added by 4f74ca8, "libobs: Port the module load rules to obs-core (#2807)"):

bool missing = (asked++, obs_module_load_rules_arg_missing(m)) ||
	       (asked++, obs_module_load_rules_arg_missing(p)) ||
	       (asked++, obs_module_load_rules_arg_missing(c));

test/cmocka/CMakeLists.txt turns on the clang C option set, which includes -Wcomma (cmake/common/compiler_common.cmake:54), and the macOS CI preset sets CMAKE_COMPILE_WARNING_AS_ERROR: true (CMakePresets.json, macos-ci).

Class

Broken CI lane: master's macOS Tier 2 lane (a merge gate) fails to compile, so every PR that selects it is red for a reason unrelated to its change.

test/cmocka/test_module_load_steps.c:65:26: error: possible misuse of comma operator here [-Werror,-Wcomma]
test/cmocka/test_module_load_steps.c:66:19: error: possible misuse of comma operator here [-Werror,-Wcomma]
test/cmocka/test_module_load_steps.c:67:19: error: possible misuse of comma operator here [-Werror,-Wcomma]
** BUILD FAILED **

How it is reached

Build 🧱 / Rust Tier 2 (macos-26) → rust/tools/tier2-validate/validate.sh → macos-ci preset (CMAKE_COMPILE_WARNING_AS_ERROR=ON) → the cmocka test target. The comma operator is intentional (the test counts how many operands the || chain actually evaluated), so it is not a defect in the test.

The PR that added the file (#2807) had macOS Tier 2 skipped by the lane-selection table (ci/ci_scope.py), and master pushes do not build macOS unless a macOS path changes, so the break reached master unseen. It surfaces now on any PR that selects test/cmocka/ or the shared cmake config, e.g. #2691 (run 40753946475, job 123054397646).

Linux Tier 2 does not catch it: the Docker Tier 2 build does not set CMAKE_COMPILE_WARNING_AS_ERROR, so the same line is a warning there.

Proposed fix and failing test

Do not edit the C test (AGENTS.md: existing C tests are never edited to satisfy a warning). Suppress the class for the test target, where the file already does exactly this for -Wpedantic/-Wmissing-prototypes/-Wstrict-prototypes:

add_compile_options($<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-comma>)

with a comment naming the deliberate comma operator in test_module_load_steps.c.

RED: the existing macOS Tier 2 job above (a clean master checkout of 0faa3c1 fails to build once the lane is selected). GREEN: the same lane configures and builds, and the cmocka suite runs. Local confirmation of either direction needs a macOS host; the lane itself is the gate.

Activity

  1. added
    bug
    on Oct 28, 2026
  2. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Claiming: #2842 — macOS Tier 2 build break from -Wcomma

    1. Suppress -Wcomma for the cmocka test target in test/cmocka/CMakeLists.txt, next to the existing -Wno-pedantic/-Wno-missing-prototypes exemptions, with a comment naming the deliberate comma operator in test_module_load_steps.c (the C test itself stays untouched).
    2. Push one branch fix/2842-macos-wcomma with the RED evidence (macOS Tier 2 log from run 40753946475) and the GREEN commit, and open the PR against master.
    3. First PR within the hour.
  3. added
    ready
    on Oct 28, 2026
  4. added
    P0
    size:S
    on Oct 28, 2026
  5. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Triage: labels P0 and size:S.

    P0 because this is a red merge gate on master, not a normal bug: while it stands, any PR that selects test/cmocka/ (or the shared cmake config) is red for a reason unrelated to its change — #2691's run 40753946475 is the example in the report. The fix is already in flight as #2843 (-Wno-comma on the cmocka C target, per the proposed fix here), so nothing else is needed on this issue; the merge of #2843 is what closes it.

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

Metadata

Metadata

Assignees

Labels

P0bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions