Repository navigation
build(obs-scripting): Exempt the SWIG Python runtime from -Wpedantic (#2695) - #2696
Merged
Merged
Conversation
The Ubuntu app build fails on master at -Werror=pedantic in shared/obs-scripting: the SWIG-generated swigpyrun.h converts function pointers to object pointers, and obs-scripting-python.h's py_error() macro uses __FUNCTION__. This test fails on master because the obs-scripting target has no -Wno-pedantic yet, and it also asserts the global C flag lists keep -Wpedantic, so the fix cannot be a tree-wide relaxation.
…2695) The Ubuntu app build (OBS-Studio-Rust variant) fails on master at -Werror=pedantic, in two files we do not own: swig/swigpyrun.h:2610-2613 ISO C forbids conversion of function pointer to object pointer type (generated: swig -external-runtime) obs-scripting-python.h:157 ISO C does not support '__FUNCTION__' (upstream glue, expanded by py_error() at obs-scripting-python-frontend.c.h:295) The obs-scripting target already opts out of -Wcast-qual for the same generated header (#516); add -Wno-pedantic to the same C-only generator expression. The global C flag lists keep -Wpedantic, and no generated file is edited. RED: ci/test_scripting_pedantic_exemption.py fails on master (1 of 3 tests). GREEN: it passes with this commit; uv run ci/msvc_flags.py stays clean.
…ppers (#2695) The first dispatched Ubuntu run cleared the obs-scripting target and then failed one step later on the SWIG wrapper objects, same diagnostic: obspythonPYTHON_wrap.c:1766-1771, 2424-2430, 2666-2669, 4482-57124 obsluaLUA_wrap.c:1176 error: ISO C forbids conversion of function pointer to object pointer type Both targets already carry -Wno-cast-qual for the same generated code; add -Wno-pedantic beside it in the same C-only generator expression. The pin now covers all three SWIG targets (obs-scripting, obspython, obslua).
The Fast Gate lint lane's gersemi -c step rejects the argument layout left by the previous commit; this is the formatter's own output, no change to the flags themselves.
#2695) Vendored librtmp logs its function name with the GNU extension __FUNCTION__, which -Wpedantic rejects in the strict C the repo builds with (CMAKE_C_EXTENSIONS FALSE, -std=c17): amf.c 16 sites, hashswf.c 7, handshake.h 22, rtmp.c 114. The Ubuntu app build compiles obs-outputs, so it fails there next, after the scripting targets are fixed. __func__ is the standard C99 identifier with identical semantics, so this is a token-for-token swap in the vendored files rather than a -Wno-pedantic on the obs-outputs target, which would also drop the diagnostic for our own code in that plugin. No behaviour changes; the vendored code stays warning-clean under the same flags. Verified locally with the real flags: gcc -std=c17 -Wpedantic -Werror -fsyntax-only over amf.c and hashswf.c went from 16 and 1 pedantic errors to 0 and 0.
Member
Author
|
Pushed |
Member
Author
|
GREEN: dispatched |
zackees
marked this pull request as ready for review
October 27, 2026 21:36
This was referenced Oct 27, 2026
This was referenced Oct 27, 2026
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
…es (obs-rust#2703) (obs-rust#2704) * ci: Pin that the SWIG scripting targets exempt -Wmissing-prototypes (obs-rust#2703) obs-rust#2678 enabled -Wmissing-prototypes tree-wide and the Ubuntu app build (OBS-Studio-Rust) and the Flatpak build now stop compiling shared/obs-scripting: the SWIG-generated glue declares its entry points with no prototype in scope. The test fails on master at all four sites that already exempt the same generated files from -Wcast-qual, and it pins that the global C lists keep the rule so the obs-rust#2624 ratchet still applies to first-party code. * build(obs-scripting): Exempt the SWIG sources from -Wmissing-prototypes (obs-rust#2703) obs-rust#2678 enabled -Wmissing-prototypes tree-wide; the Ubuntu app build (OBS-Studio-Rust) and the Flatpak build then stopped compiling shared/obs-scripting, because the SWIG-generated glue declares its entry points with no prototype in scope: obs-scripting-lua-frontend.c.h:320 add_lua_frontend_funcs obs-scripting-lua-source.c.h:766 undef_lua_script_sources obs-scripting-lua.c.h:1075..1320 obs_lua_script_* / obs_lua_load / obs_lua_unload obs-scripting-python-frontend.c.h:418 add_python_frontend_funcs Generated code cannot be edited, so each SWIG target opts out of that one diagnostic beside the -Wno-cast-qual (obs-rust#516) and -Wno-pedantic (obs-rust#2696) exemptions it already carries: obs-scripting (lua.cmake, python.cmake), obspython and obslua for their own wrapper objects. The global C lists keep -Wmissing-prototypes and -Wstrict-prototypes, so the obs-rust#2624 ratchet still applies to first-party code. RED: ci/test_scripting_missing_prototypes.py fails at all four sites. GREEN: it passes; ci/test_scripting_pedantic_exemption.py, ci.test_uv_run and ci.test_ci_toml stay green, gersemi ok. * build(obs-scripting): Exempt -Wstrict-prototypes too (obs-rust#2703) The Ubuntu app build passed the -Wmissing-prototypes sites and then stopped one TU later on the same generated glue, which declares functions as 'foo()' rather than 'foo(void)': shared/obs-scripting/obs-scripting-python.c.h:741:25 error: function declaration isn't a prototype [-Werror=strict-prototypes] obs-rust#2678 enabled both rules together, so both exemptions travel together; the pin test now asserts each C-only genex carries both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
The Ubuntu app build (
build-project.yamlubuntu-build, the OBS-Studio-Rust variant) fails onmasterat-Werror=pedanticinshared/obs-scripting. PR CI cannot see it — PRs run no app build — so it only shows in a nightly / dispatchedScheduledrun.Neither file is ours:
swig/swigpyrun.his generated (swig -external-runtime) andpy_error()is the upstream glue macro around__FUNCTION__.Fix
shared/obs-scripting/cmake/python.cmakealready opts theobs-scriptingtarget out of-Wcast-qualfor that same generated header (#516). This adds-Wno-pedanticto the same C-only generator expression. No generated file is edited and the global C flag lists keep-Wpedantic— a new pin asserts that.RED
175e351a0addsci/test_scripting_pedantic_exemption.py, which fails onmaster:GREEN
5ab5211b2adds the flag. Local:The flag mechanism itself, on the exact diagnostics (a 6-line C file compiled with
-std=c11 -Wpedantic -Werror, then with the added-Wno-pedantic): both errors appear, then exit 0.The authoritative GREEN is the Ubuntu app-build lane on this branch — a dispatched
Scheduledrun is in flight; its link and result go in the next comment.Fixes #2695
Second batch: the SWIG wrappers and vendored librtmp
The first dispatched run cleared
obs-scriptingand then failed one step later, on the same diagnostic in the SWIG wrapper objects (obspythonPYTHON_wrap.c,obsluaLUA_wrap.c) —-Wno-pedanticadded beside their existing-Wno-cast-qual(71fc87df7), and the pin covers all three SWIG targets.It also proved the class reaches vendored librtmp, which logs with the GNU
__FUNCTION__(amf.c 16, hashswf.c 7, handshake.h 22, rtmp.c 114 sites). That is fixed as a token-for-token__func__swap (ab81a7b23) — the standard C99 identifier, identical semantics — rather than-Wno-pedanticonobs-outputs, which would also drop the diagnostic for our own code in that plugin. Local:gcc -std=c17 -Wpedantic -Werror -fsyntax-onlyover amf.c/hashswf.c went 16/1 → 0/0.GREEN on the lane
Dispatched
Scheduledon this branch, run 40585658256:Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust)passes — the app build compilesshared/obs-scriptingandobs-outputsat-Wpedanticnow. PR CI is green (CI Gate ✅), Tier 2 Linux included.