Skip to content

build(obs-scripting): Exempt the Lua SWIG sources from -Wpedantic (#2711) - #2712

Merged
zackees merged 2 commits into
masterfrom
infra/2711-lua-pedantic-exemption
Oct 28, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2711-lua-pedantic-exemption

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Fixes #2711.

-Wno-pedantic for the SWIG-generated scripting sources landed only 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, so with Python on the exemption covers it by accident; with Python off it does not apply at all. The AppImage build is that configuration (build-aux/appimage/build.py:77, -DENABLE_SCRIPTING_PYTHON=OFF), and -Wpedantic (#2623) then applies to generated glue again.

RED

eda2d2d39 — ci/test_scripting_pedantic_exemption.py now reads every file that compiles SWIG code into a target instead of one file per target, and adds test_the_lua_sources_are_exempt_even_with_python_off. On f0bb6aabf:

uv run python -m unittest ci/test_scripting_pedantic_exemption.py
FAIL: test_each_generated_swig_target_opts_out_of_pedantic
  AssertionError: '-Wno-pedantic' not found in
  '\n    PRIVATE\n      $<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>:-Wno-cast-qual;-Wno-missing-prototypes;-Wno-strict-prototypes>\n  '
FAIL: test_the_lua_sources_are_exempt_even_with_python_off
FAILED (failures=2)

GREEN

1c98cef33 — -Wno-pedantic added to the C-only COMPILE_LANG_AND_ID genex in cmake/lua.cmake, beside the #516 and #2703 diagnostics for the same generated files, with the reason recorded in the comment.

Ran 4 tests in 0.001s
OK
./lint: ok (43.5s)

Why the flag belongs in both files

The obs-scripting target compiles the Lua glue with or without Python; the exemption is per diagnostic for generated code, not per option. python.cmake keeps its copy (that target still has py_error(), which uses __FUNCTION__), and lua.cmake now carries its own so neither configuration depends on the other.

Scope and verification

CI/configuration fix, so RED and GREEN are pushed together (coordination.md §4) with local evidence above. No user-visible change: no docs/features.md line.

The diagnostic text is from the app lanes (build/obs-scripting, obs-scripting-lua.h:200, obs-scripting-lua-source.c.h:110/:71, obs-scripting-lua-frontend.c.h:21/:23), reproduced pre-#2696 in run 40594533995 job 122507234793. Not proven by a full AppImage build here: that lane sets CMAKE_COMPILE_WARNING_AS_ERROR=OFF (build.py:66-67), so today the effect is warning output rather than a failure — the flag restores the intended exemption and keeps the build correct if that lane, or any other with ENABLE_SCRIPTING_PYTHON=OFF, ever compiles with warnings as errors. Say so if you want an AppImage dispatch on the branch as well.

The exemption landed only in python.cmake, so a configuration with
ENABLE_SCRIPTING_PYTHON=OFF (the AppImage build) compiles the Lua SWIG
glue with -Wpedantic again. Fails on master:
  test_each_generated_swig_target_opts_out_of_pedantic
  test_the_lua_sources_are_exempt_even_with_python_off
The pedantic exemption for obs-scripting sat in cmake/python.cmake, inside
if(ENABLE_SCRIPTING_PYTHON). The AppImage build configures with
-DENABLE_SCRIPTING_PYTHON=OFF and still compiles the Lua SWIG runtime into
the same target, so -Wpedantic (#2623) applied to generated glue again.
Carry the diagnostic opt-out beside its #516/#2703 siblings in lua.cmake.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review (head 1c98cef33). I reproduced both sides myself rather than reading the body only.

What I verified

  • Facts in the body, checked on master 6ae5bc10f: build-aux/appimage/build.py:77 really does pass -DENABLE_SCRIPTING_PYTHON=OFF, and -Wpedantic is in both global C lists (cmake/common/compiler_common.cmake:72, cmake/linux/compilerconfig.cmake:69), so with Python off nothing exempted the Lua SWIG glue. The diagnosis holds.
  • RED, reproduced: in a worktree at the PR head, git checkout origin/master -- shared/obs-scripting/cmake/lua.cmake then uv run python -m unittest ci/test_scripting_pedantic_exemption.py → FAILED (failures=2), including cmake/lua.cmake must carry -Wno-pedantic for obs-scripting.
  • GREEN, reproduced: same command on the PR head → Ran 4 tests … OK.
  • Formatting: uvx gersemi==0.25.0 -c shared/obs-scripting/cmake/lua.cmake is clean, so the lint lane will not reject the moved flag list.
  • Placement: -Wno-pedantic sits inside the COMPILE_LANG_AND_ID:C,… genex beside -Wno-cast-qual / -Wno-missing-prototypes / -Wno-strict-prototypes, which is exactly the shape the #516/#2695/#2703 exemptions already use — C-only, target-scoped, never a global -Wno-*.

Notes, none blocking

  1. test_the_lua_sources_are_exempt_even_with_python_off restates what the widened test_each_generated_swig_target_opts_out_of_pedantic loop already asserts for lua.cmake. It is harmless and the failure message names the reason, so I would keep it — just be aware it is a second pin on one fact, not new coverage.
  2. Your scope note is right and worth keeping in the body: the AppImage lane sets CMAKE_COMPILE_WARNING_AS_ERROR=OFF (build.py:66-67), so today this restores the intended silence rather than fixing a red. I do not want an AppImage dispatch spent on it — the config change is provable by reading the two option lists, which the test now pins.

No docs/features.md line is correct: build configuration only, nothing a user can observe. No ci.toml change, so the GEN-005 baseline is untouched.

Approved from the coordinator side. I will queue it once Fast Gate ⚡ and Rust Tier 2 Linux 🐧 (build) finish on this head.

@zackees
zackees added this pull request to the merge queue Oct 28, 2026
@zackees

zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

  • PR CI green: Format checks, Fast Gate, CI Mode, Validate Data, and all four Rust Tier 2 Linux lanes pass; the rest skip (this change selects no macOS/Windows/Qt/flatpak path).
  • Local gate: ./lint ok (43.5s); ./unittest rust-test lane ok (606s), tier2-linux refused to start (obs-rust-linux-validate-ee469c0621f3 is already running) — environmental, and Tier 2 is covered by the PR's own lanes above. HEAD is not stamped for that reason; a stamp would need a push that re-runs the same CI.
  • Auto-merge on, queued (position 1).

Merged via the queue into master with commit d82a994 Oct 28, 2026
37 checks passed
@zackees
zackees deleted the infra/2711-lua-pedantic-exemption branch October 28, 2026 00:10
zackees added a commit that referenced this pull request Oct 28, 2026
GREEN: check_buffer, the four SIMD repack functions and the two scalar
fallbacks are reached only through audio_repack_init's repack_func slot in
this unity group, so they are file-scope private. audio_repack_init and
audio_repack_free keep their prototypes in audio-repack.h.

This clears the next -Wmissing-prototypes failure the Flatpak app lane hits
after #2710 and #2712: the lane compiles past the audio repack unit instead
of stopping there.
MCPVOT pushed a commit to MCPVOT/obs-studio that referenced this pull request Oct 30, 2026
…2703) (obs-rust#2717)

* ci: Pin that the aja audio-repack helpers are static (obs-rust#2703)

RED: ci/test_aja_missing_prototypes.py fails on master with seven
file-scope definitions in plugins/aja/audio-repack.c.h that are neither
static nor declared in the plugin's headers. The Flatpak app build is the
only lane that compiles them and it stops at

  audio-repack.c.h:5: error: no previous prototype for 'check_buffer'
  [-Werror=missing-prototypes]

* fix(aja): Make the audio-repack helpers static (obs-rust#2703)

GREEN: check_buffer, the four SIMD repack functions and the two scalar
fallbacks are reached only through audio_repack_init's repack_func slot in
this unity group, so they are file-scope private. audio_repack_init and
audio_repack_free keep their prototypes in audio-repack.h.

This clears the next -Wmissing-prototypes failure the Flatpak app lane hits
after obs-rust#2710 and obs-rust#2712: the lane compiles past the audio repack unit instead
of stopping there.

* ci: Pin the linux-jack process callback as static (obs-rust#2703)

RED: ci/test_linux_jack_missing_prototypes.py fails on master with

  plugins/linux-jack/jack-wrapper.c.h:56: jack_process_callback

a file-scope definition that is neither static nor declared in a header.
The Flatpak app build is the only lane that compiles the JACK plugin and it
stops there with -Werror=missing-prototypes.

* fix(linux-jack): Make the process callback static (obs-rust#2703)

GREEN: jack_process_callback is the jack_set_process_callback argument used
only by jack_init in the same translation unit, so it is file-scope private.
jack_init and deactivate_jack keep the prototypes jack-wrapper.h declares.

* style(aja): clang-format the static shuffle_8ch signature (obs-rust#2703)

The added `static` pushed the declaration past 120 columns; clang-format
22.1.3 rewraps it the way ./lint --fix does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

1 participant