Repository navigation
frontend-tools: Host code behind frontend-tools-host.h (#855) - #1292
Merged
Merged
Conversation
frontend-tools-host.h with stub POSIX/macOS/Windows hosts; the new
test_frontend_tools_host{,_macos} cmocka tests fail against the stubs.
The captions load/unload, the scene switcher's Wayland check, the Python
settings tab and the macOS Python.framework path trim move behind a
conditional-free host interface: frontend-tools-host-{windows,macos,posix}
in per-OS unity groups, the switcher check next to each host's window
lookup. The captions' Windows SDK includes and MSVC pragmas move into the
Windows-named captions-host-windows.hpp and the captions PCH takes the
Windows name. The cross check compiles the Windows and macOS host groups.
Baseline: the six plugins/frontend-tools entries (12 findings) go to 0.
InitScripts pointed python_path at a std::string that was destroyed at the end of its block, then passed it to obs_scripting_load_python: a use-after-free whenever a saved path under Python.framework/Versions was trimmed. The trimmed string now lives as long as python_path.
zackees
enabled auto-merge
October 17, 2026 17:35
Member
Author
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 17, 2026
This was referenced Oct 18, 2026
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.
Fixes #855. Same structure as #1248 / #1252 / #1257 / #1263.
Moved
frontend-tools.c.h:InitCaptions/FreeCaptionsunder_WIN32becomefrontend_tools_host_load()/frontend_tools_host_unload(). Windows calls the captions functions; the other hosts do nothing.auto-scene-switcher.cpp.hpp: the Wayland skip becomesfrontend_tools_host_scene_switcher_supported(), defined next to each host's window lookup in the existingauto-scene-switcher-{nix,win,osx}. OnlynixchecksplatformName()for wayland; Windows and macOS return true.scripts.cpp.hpp:_WIN32 || __APPLE__part ofPYTHON_UIbecomesfrontend_tools_host_python_ui()(true on Windows and macOS). The non-hostPython_FOUNDcheck stays as it was. Note: nothing in this tree definesPython_FOUNDfor frontend-tools, so the tab stays off everywhere, as before./Python.framework/Versionstrim becomesfrontend_tools_host_python_path_len(). macOS cuts the path there; the other hosts keep the full length.<windows.h>and the_MSC_VERpragmas around<sphelper.h>move into the new Windows-namedcaptions-host-windows.hpp.captions-mssapi.hppandcaptions-mssapi-stream.hppinclude it. The captions PCH is renamedbuild/frontend-tools-captions-windows.pch.hpp. No upstream file is renamed.frontend-tools-host.h(no host conditionals)frontend-tools-host-{windows,macos,posix}.c.hbuild/frontend-tools.host-{windows,macos,posix}+.h.cand their PCHs; CMake picks one per platform.Baseline delta (
ci/platform-ifdef-baseline.json, regenerated with--updateafter rebasing)All six frontend-tools entries go to 0, removing 12 findings:
auto-scene-switcher.cpp.hppbuild/frontend-tools-captions.pch.hppcaptions-mssapi-stream.hppcaptions-mssapi.hppfrontend-tools.c.hscripts.cpp.hppBehaviour fix, in its own commit
"frontend-tools: Keep the trimmed Python path alive (macOS)" fixes a use-after-free from upstream.
python_pathpointed at astd::stringthat was destroyed at the end of its block, and was then passed toobs_scripting_load_python. The trimmed string now lives as long aspython_path. Every other change in this PR is meant to keep behaviour exactly as it was.Tests
New self-contained cmocka tests:
test/cmocka/test_frontend_tools_host.c(posix host) andtest_frontend_tools_host_macos.c(the macOS host is plain C, so its trim is tested on Linux). They link only cmocka and leave existing test targets unchanged.cfcf22128, stub hosts):rust/tools/linux-validate/run.sh --repeat 1 --tests test_frontend_tools_hostgave 282/284 passing. Only the two new tests failed: posixtest_python_path_kept; macOStest_python_ui,test_python_path_trimmedandtest_python_path_kept../lintwas clean on each commit.Windows/macOS coverage
ci/ci_scope.pyputsplugins/frontend-tools/inQT_AREAS, so this PR selects no Windows lane. It selects macOS only through the cross/scope flag; no macOS app build runs. I addedfrontend-tools-host-crosstocmake/cross/CMakeLists.txt, which compiles the Windows and macOS host groups. I ran it locally withcmake/cross/docker.sh:frontend-tools.host-windows+.h.ccompiled. The run then stopped on errors in win-dshow, unrelated to this PR (dshowcapture headers missing in this worktree).frontend-tools.host-macos+.h.c.No CI job runs
cmake/cross/(thecrosslane is Rust only), so that check is local evidence only.Files no CI job compiles (they need Qt, the Windows SDK or AppKit):
plugins/frontend-tools/frontend-tools-host-windows.c.h(local cross check only)plugins/frontend-tools/frontend-tools-host-macos.c.h(local cross check, plus the Linux cmocka test)plugins/frontend-tools/captions-host-windows.hpp,captions-mssapi.hpp,captions-mssapi-stream.hpp,captions.cpp.hpp,build/frontend-tools-captions-windows.pch.hpp,build/frontend-tools.captions-windows+.hpp.cppplugins/frontend-tools/auto-scene-switcher-win.cpp.hpp,auto-scene-switcher-osx.mm.hpp,build/frontend-tools-{windows,macos}.pch.hppscripts.cpp.hppandauto-scene-switcher.cpp.hpp. The Linux Qt lane compiles their shared code.