Skip to content

infra: The Ubuntu app build fails at -Werror=pedantic in obs-scripting (#2643 fallout) #2695

Closed

Description

@zackees

The Ubuntu app build (build-project.yaml ubuntu-build, the OBS-Studio-Rust variant) fails on current master at -Werror=pedantic in shared/obs-scripting. PR CI cannot see it — PRs run no app build, and the Push workflow builds no OBS app — so this only shows in the nightly / a dispatched Scheduled run.

Evidence

Dispatched Scheduled on fix/2626-msvc-w4 (= origin/master c2af3f9c3 plus two Windows-only commits, so nothing in this failure is branch-specific), job Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust):

build_ubuntu/shared/obs-scripting/swig/swigpyrun.h:2610:22: error: ISO C forbids conversion of function pointer to object pointer type [-Werror=pedantic]
build_ubuntu/shared/obs-scripting/swig/swigpyrun.h:2611:19: error: ... [-Werror=pedantic]
build_ubuntu/shared/obs-scripting/swig/swigpyrun.h:2612:18: error: ... [-Werror=pedantic]
build_ubuntu/shared/obs-scripting/swig/swigpyrun.h:2613:23: error: ... [-Werror=pedantic]
shared/obs-scripting/obs-scripting-python.h:157:57: error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
  169 | #define py_error() py_error_(__FUNCTION__, __LINE__)
shared/obs-scripting/obs-scripting-python-frontend.c.h:295:17: note: in expansion of macro 'py_error'
cc1: all warnings being treated as errors

Same run: Build 🧱 / Flatpak 📦 also failed (step Build Flatpak Manifest 🧾, not yet triaged), and the Windows/macOS app jobs died earlier at Install the Rust toolchain 🦀 (infrastructure, unrelated).

Cause

#2643 / #2623 added -Wpedantic to the Clang and GNU C option lists in cmake/common/compiler_common.cmake. shared/obs-scripting compiles:

  • SWIG-generated code (swig/swigpyrun.h, generated into the build dir) that converts function pointers to object pointers — a deliberate, standard SWIG idiom;
  • obs-scripting-python.h:157, which uses __FUNCTION__, a GNU extension that -Wpedantic rejects in strict C.

Neither is first-party code: one is generated, one is upstream glue. The vendored/generated-code exemption in #516 applies.

Suggested fix

A target-scoped suppression on the obs-scripting-python module (shared/obs-scripting/cmake/python.cmake, where the MSVC /wd4100;/wd4204 and /wd4152 exemptions already live), i.e. -Wno-pedantic (or -Wno-error=pedantic for the generated SWIG include path only) for the GNU/Clang C language on that target, plus the same for the frontend that includes obs-scripting-python-frontend.c.h. Do not edit the SWIG output, and do not weaken -Wpedantic globally.

RED/GREEN is the app-build lane: uv run ci/local_gate.py --lane tiers does not cover it; a gh workflow run scheduled.yaml --ref <branch> (Ubuntu app build) is the smallest reproduction, or bosn run --task ubuntu if a local native tree exists.

Activity

  1. added
    infra
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: investigation

    Plan (this tick):

    1. Re-read the failing compile in shared/obs-scripting and confirm both diagnostics belong to code we do not own: swig/swigpyrun.h is SWIG-generated (-external-runtime) and obs-scripting-python.h:157 is the upstream glue macro using __FUNCTION__.
    2. Fix it as a target-scoped exemption on the obs-scripting target, next to the existing -Wno-cast-qual line that already cites build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516 for the same generated header (shared/obs-scripting/cmake/python.cmake). No global weakening of -Wpedantic, no edit to generated output.
    3. RED/GREEN is the Ubuntu app-build lane (Scheduled / Ubuntu 🐧 (OBS-Studio-Rust) dispatched on the branch), since PR CI does not build the app. I will post the run link with the result.
  3. added
    needs-investigation
    on Oct 27, 2026
  4. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    /ready

  5. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: obs-scripting -Wpedantic exemption

    Both diagnostics are in code we do not own — swig/swigpyrun.h is generated by swig -external-runtime and obs-scripting-python.h:157 is the upstream py_error() macro around __FUNCTION__ — so the fix is the target-scoped suppression the issue suggests, placed beside the existing -Wno-cast-qual exemption for the same generated header (shared/obs-scripting/cmake/python.cmake, #516). No generated file is edited and -Wpedantic stays in the global C lists (a new pin, ci/test_scripting_pedantic_exemption.py, asserts both).

    PR: #2696 (draft until the lane reports).

  6. added
    ready
    and removed
    needs-investigation
    on Oct 27, 2026
  7. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Progress on #2695 — the first dispatched Ubuntu run (workflow_dispatch on the branch) got past obs-scripting and revealed two more members of the same class, both now in PR #2696:

    1. the SWIG wrapper objects obspythonPYTHON_wrap.c / obsluaLUA_wrap.c fail on the same "function pointer to object pointer type" pedantic error — the obspython and obslua targets now carry -Wno-pedantic beside their existing -Wno-cast-qual, and the pin covers all three SWIG targets;
    2. vendored librtmp logs with __FUNCTION__ (amf.c 16, hashswf.c 7, handshake.h 22, rtmp.c 114 sites), so obs-outputs fails next. Fixed as a token-for-token __func__ swap in the vendored files rather than a target-scoped -Wno-pedantic on obs-outputs, which would also drop the diagnostic for our own code in that plugin.

    Second dispatched run in flight on the branch: https://github.com/obs-rust/obs-studio/actions/runs/40585658256

  8. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    The Ubuntu app build passes on the branch now: dispatched Scheduled run 40585658256, job Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust) success, with PR CI CI Gate ✅ green (Tier 2 Linux tests ON/OFF included).

    Final shape of PR #2696 (queued, handed to the coordinator):

    class where fix
    ISO C forbids function pointer → object pointer swig/swigpyrun.h, swig/swigluarun.h (generated) and the py_error() __FUNCTION__ macro target-scoped -Wno-pedantic on obs-scripting, beside the -Wno-cast-qual exemption that already exists there (#516)
    same, in the SWIG wrapper objects obspythonPYTHON_wrap.c, obsluaLUA_wrap.c (generated) target-scoped -Wno-pedantic on obspython/obslua, beside their -Wno-cast-qual
    ISO C does not support __FUNCTION__ vendored librtmp (amf.c 16, hashswf.c 7, handshake.h 22, rtmp.c 114) token-for-token __func__ (standard C99, same semantics) — not a target-scoped suppression, so obs-outputs keeps the diagnostic for our own code

    -Wpedantic stays in the global C lists, pinned by the new ci/test_scripting_pedantic_exemption.py.

    Not covered here, and unrelated to this issue: the same first run also saw Build 🧱 / Flatpak 📦 fail in Build Flatpak Manifest 🧾 (still untriaged as the issue notes), and the run was started on a branch whose Windows/macOS app jobs died at Install the Rust toolchain 🦀.

  9. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Landed as #2696 (merge commit 1369daf30, merged 2026-10-27T21:46:04Z). What it changes — all three members of the same -Wpedantic class in shared/obs-scripting:

    1. swig/python.cmake: target-scoped -Wno-pedantic for the SWIG Python runtime (the generated swigpyrun.h function-pointer-to-object-pointer idiom).
    2. The SWIG wrapper target inherits the same exemption (the frontend that includes obs-scripting-python-frontend.c.h).
    3. plugins/obs-outputs librtmp: __FUNCTION__ -> __func__ in first-party code so -Wpedantic accepts it; python.cmake reformatted by gersemi in the same PR.

    No global weakening of -Wpedantic; the generated SWIG output is not edited.

    Verification: dispatched Scheduled on the branch (run 40585658256) — Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust) success, the only lane that can see this failure (PR CI runs no OBS app build). PR CI Gate ✅ and Fast Gate green.

    Left over, not part of this PR: the same dispatched run reported Build 🧱 / Flatpak 📦 failing at Build Flatpak Manifest 🧾, which the issue text lists as untriaged. That is a separate failure class and needs its own issue rather than a rider on this one.

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

Metadata

Metadata

Assignees

Labels

infraready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions