Skip to content

infra: obs-scripting loses the -Wpedantic exemption when ENABLE_SCRIPTING_PYTHON=OFF (the AppImage build) #2711

Closed

Description

@zackees

#2696 added -Wno-pedantic for the SWIG-generated scripting sources, but it landed in shared/obs-scripting/cmake/python.cmake, inside if(ENABLE_SCRIPTING_PYTHON). The Lua SWIG runtime is compiled into the same obs-scripting target from cmake/lua.cmake, whose exemption list has -Wno-cast-qual, -Wno-missing-prototypes and -Wno-strict-prototypes (#516, #2703) but not -Wno-pedantic.

While Python is on, the python.cmake genex is applied to the whole target, so the Lua sources are covered by accident. With Python off, that option disappears and -Wpedantic (#2623) applies to generated Lua glue again. The AppImage build is exactly that configuration.

Evidence

build-aux/appimage/build.py:70-78:

cmake --preset ubuntu-ci \
  ...
  -DENABLE_SCRIPTING_PYTHON=OFF

shared/obs-scripting/cmake/python.cmake:56-60 (the only place -Wno-pedantic is applied to obs-scripting):

  target_compile_options(
    obs-scripting
    PRIVATE
      $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-cast-qual;-Wno-pedantic;-Wno-missing-prototypes;-Wno-strict-prototypes>
  )

shared/obs-scripting/cmake/lua.cmake:44-49 — the same generated files, no -Wno-pedantic:

  target_compile_options(
    obs-scripting
    PRIVATE
      $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-cast-qual;-Wno-missing-prototypes;-Wno-strict-prototypes>
  )

The diagnostics are the ones the app lanes already reported for these exact files before #2696 (run 40594533995, job 122507234793, Build linux x86_64 🧱):

shared/obs-scripting/obs-scripting-lua.h:200:80: error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
shared/obs-scripting/obs-scripting-lua-source.c.h:110:81: ... [-Werror=pedantic]
shared/obs-scripting/obs-scripting-lua-frontend.c.h:21:74: ... [-Werror=pedantic]

obs-scripting-lua.h:200 is #define verify_args1(script, param1_check) verify_args1_(script, param1_check, __FUNCTION__); obs-scripting-lua-source.c.h:110 is the ls_push_libobs_obj macro. Both are our own glue over SWIG's runtime, i.e. the same "not ours to rewrite" class as #2695.

Severity today: the AppImage configure also passes -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF (build.py:66-67), so the lane prints the warnings instead of failing. It is the only configuration that turns Python off, so nothing is red right now — but the exemption is stated per-diagnostic for generated code, and any warnings-as-errors configuration with ENABLE_SCRIPTING_PYTHON=OFF (or a future one) fails the build. It also floods the AppImage log that #2182 is trying to read.

Proposed fix

Move the pedantic exemption next to its siblings in cmake/lua.cmake (add -Wno-pedantic to that genex and cite #2695 in the comment beside the #516/#2703 ones), and pin it offline: ci/test_scripting_pedantic_exemption.py must assert that every file that adds the SWIG sources carries the exemption, not only the file guarded by an ENABLE_SCRIPTING_* option.

Failing test: a case in ci/test_scripting_pedantic_exemption.py that reads cmake/lua.cmake and requires -Wno-pedantic in the C-only COMPILE_LANG_AND_ID genex for obs-scripting (fails on master: the string is absent), plus a case that the obs-scripting pedantic exemption is not reachable only through python.cmake.

Scope: one CI/configuration fix, RED and GREEN commits pushed together (coordination.md §4); the global C flag lists keep -Wpedantic.

Activity

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

    @zackees
    MemberAuthor

    Claiming: investigation — I filed this from the app-lane diagnostics and the AppImage configure flags; the repro is already complete, so it is ready for the implementation unit.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    /ready

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

    @zackees
    MemberAuthor

    Claiming: the -Wpedantic exemption for the Lua SWIG sources.

    PR #2712 is up (RED eda2d2d39, GREEN 1c98cef33): -Wno-pedantic goes into cmake/lua.cmake's C-only genex beside the #516/#2703 exemptions for the same generated files, and ci/test_scripting_pedantic_exemption.py now reads every file that compiles SWIG code into a target instead of one per target (RED: 2 failures on f0bb6aabf, GREEN: 4/4, ./lint ok).

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