Repository navigation
build(obs-scripting): Exempt the SWIG sources from -Wmissing-prototypes (#2703) - #2704
Conversation
…2703) #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 #2624 ratchet still applies to first-party code.
…es (#2703) #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 (#516) and -Wno-pedantic (#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 #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.
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] #2678 enabled both rules together, so both exemptions travel together; the pin test now asserts each C-only genex carries both.
zackees
left a comment
There was a problem hiding this comment.
Reviewed. The exemption is the right shape and the test holds both ends of it.
RED → GREEN, checked locally in a worktree of the PR head:
- on the test-only commit
62606d0the new test fails as intended —'-Wno-missing-prototypes' not found in {'-Wno-cast-qual'}for bothobs-scriptingsites andobspython; - on
a59ab09it passes (Ran 2 tests ... OK).
Scope is complete. grep -rn Wno-cast-qual over shared/obs-scripting finds exactly the four sites the test walks (cmake/lua.cmake, cmake/python.cmake, obslua/CMakeLists.txt, obspython/CMakeLists.txt), so there is no fifth SWIG target left at the rule. The exemption stays inside the COMPILE_LANG_AND_ID:C,... generator expression, so C++ in the same target keeps the diagnostic, and the second test pins that the global _obs_clang_c_options and the GNU C option line still carry -Wmissing-prototypes/-Wstrict-prototypes, which is what keeps #2624's ratchet meaningful for first-party code.
Two things worth knowing, neither a blocker:
-Wstrict-prototypescame in with the same change (#2678). It fires on a declaration likeint f();, which is the other half of "no prototype in scope". If a Linux app lane comes back red on these files after this lands, the log will name that diagnostic rather than this one, and the same four sites take it the same way. Nothing in the PR claims otherwise, so I read the evidence as: only-Wmissing-prototypesfired.- No PR lane proves this fix. That is the point of the issue (#2703: same SHA green on PR, red on
Scheduled), so after the merge the proof is the nextScheduled/push run of the UbuntuOBS-Studio-Rustand Flatpak lanes, not this PR's checks. Worth watching those rather than trusting this PR's green.
Queuing it once its checks settle.
|
Re-checked on the amended head Verified locally in a worktree, RED first:
So the RED still precedes the GREEN for the new flag, and the global-flag assertions are unchanged. I also see the |
The dispatched run found one more diagnostic in the same generated glue — fixed in
|
|
Heads-up from the
That is first-party C (
My review above stands on the change itself: it is correct and needed, it just is not the whole of #2703. |
…ust#2703) (obs-rust#2710) * test: Pin that libobs-opengl platform definitions are static or declared (obs-rust#2703) RED: ci/test_platform_missing_prototypes.py fails on master with libobs-opengl/gl-wayland-egl.c.h:90: gl_wayland_egl_windowinfo_create — a file-scope definition that is neither static nor declared in a header. The app builds are the only lanes that compile it and they stop there with -Werror=missing-prototypes. * fix(libobs-opengl): Make the Wayland windowinfo factory static (obs-rust#2703) GREEN: the helper is only reached through its gl_winsys_vtable slot, so it is file-scope private; the X11 sibling gl_x11_egl_windowinfo_create is already static. This clears the next -Wmissing-prototypes failure the Ubuntu and Flatpak app lanes hit after obs-rust#2704.
Fixes #2703
The Linux app builds (Ubuntu
OBS-Studio-Rust, Flatpak) are red on master since #2678 put-Wmissing-prototypes/-Wstrict-prototypesin the global C option lists: the SWIG-generated glue inshared/obs-scriptingdeclares its entry points with no prototype in scope, so theobs-scriptingtarget fails at-Werrorand neither lane reaches packaging. #2696 fixed the same files for-Wpedanticthree hours earlier; the exemption is per-diagnostic, so it does not cover #2678's flags.No PR lane sees this: the same SHA's PR run was green while
Scheduledon it failed both lanes.RED —
62606d055ci/test_scripting_missing_prototypes.py(new) walks the four sites that already exempt the same generated files from-Wcast-qual(obs-scriptingincmake/lua.cmakeandcmake/python.cmake, plus theobspythonandobsluawrapper targets) and requires-Wno-missing-prototypesin the same C-onlyCOMPILE_LANG_AND_IDgenerator expression; it also pins that the global C lists keep-Wmissing-prototypesand-Wstrict-prototypesso the #2624 ratchet still applies to first-party code.On master it fails at all four sites:
GREEN —
a59ab09ebOne flag added beside the existing exemptions; no generated file edited, no global flag relaxed, nothing added outside a C-only generator expression:
shared/obs-scripting/cmake/lua.cmake(obs-scripting)-Wno-cast-qual-Wno-cast-qual;-Wno-missing-prototypesshared/obs-scripting/cmake/python.cmake(obs-scripting)-Wno-cast-qual;-Wno-pedantic+;-Wno-missing-prototypesshared/obs-scripting/obspython/CMakeLists.txt…;-Wno-pedantic+ -Wno-missing-prototypesshared/obs-scripting/obslua/CMakeLists.txt…;-Wno-pedantic+ -Wno-missing-prototypesThe
obspython/obsluawrapper objects were not reached by either red lane (ninjastopped inobs-scriptingfirst), so their addition follows #2696, which exempted all three targets for-Wpedantic— the same generated wrapper sources, same reason.Evidence this fixes
Scheduled Repository Actionsdispatched onfix/2699-app-build-soldratc7769380(run 40591042433):Build 🧱 / Ubuntu 🐧 (OBS-Studio-Rust)— failure, job 122495240031: 11-Werror=missing-prototypesdiagnostics inshared/obs-scripting,ninja: build stoppedBuild 🧱 / Flatpak 📦— failure, job 122495240167: the same ten Lua-object diagnostics, thenBuild failed: … xvfb-run failed with exit code 1Local checks
uv run python -m unittest ci.test_scripting_missing_prototypes ci.test_scripting_pedantic_exemption— 5 tests, OK (RED before the GREEN: 4 failures).uvx [email protected] check ci/test_scripting_missing_prototypes.py— clean (noruff format, per the repo'sruff.toml).uv run --no-project ci/local_gate.py --only gersemi— ok (the newtarget_compile_optionscall is gersemi's own layout).uv run python -m unittest ci.test_uv_runandci.test_ci_toml— 5 + 41 tests, OK.Verification pending (this PR's real gate)
Verification — what the dispatched lanes actually show
Three
workflow_dispatchruns ofScheduled Repository Actionson this branch, in order:a59ab09e, run 40594398865 —Ubuntu 🐧compiled past all eleven-Wmissing-prototypesdiagnostics and stopped one TU later onobs-scripting-python.c.h:741:25 error: function declaration isn't a prototype [-Werror=strict-prototypes];Flatpak 📦never reached the compiler (see bug: Flatpak lane fails to spawn ci/flatpak_builder_lint.py — the action passes ${{ github.workspace }} where the job runs in /__w (#2702 regression) #2705).ec608e33, run 40595018476 — theobs-scriptingtarget now builds: 9 C objects compiled, zero diagnostics, and the lane advanced tolibobs-opengl.libobs-opengl/gl-wayland-egl.c.h:90:23: error: no previous prototype for 'gl_wayland_egl_windowinfo_create'. That is a build(cmake): compile C with -Wmissing-prototypes and -Wstrict-prototypes (#2624) #2678 gap (its-fsyntax-onlyreplay covered the Tier 2 compdb, not the Ubuntu app build's Wayland/Qt TUs), one token from fixed (static, asgl-x11-egl.c.h:236already does), and filed on the ratchet issue build(cmake): Drop -Wno-missing-prototypes and -Wno-strict-prototypes #2624 rather than folded in here.So the exemption this PR adds is proven by (2), and the two lanes that carry it are still red only for causes outside this diff: #2705 (Flatpak, fails before compiling) and the #2624 backfill (Ubuntu, first-party prototype). PR CI is green.