From 7f6207242c339af3fa502161f22f99e70ef7eda0 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Sun, 25 Oct 2026 12:37:22 +0100 Subject: [PATCH 1/4] ci: RED the macOS browser helpers follow the app identity (#2386) Chromium finds its helper apps by the main executable's name (" Helper", "(GPU)", "(Plugin)", "(Renderer)"). obs-browser names them "OBS Helper" while the Rust brand's app is "OBS-Studio-Rust", so the GPU process fails to launch (error_code=1003) and adding a browser source crashes OBS. test_macos_browser_helpers.py checks that obs-browser's macOS CMake resolves the helpers to " Helper" and ".helper" for both brands (upstream keeps "OBS Helper" and com.obsproject.obs-studio.helper), and that app_identity_check.py's bundle check, which the release workflow runs on every macOS app, rejects helpers named otherwise. Two of four fail: the pinned obs-browser hard-codes the upstream names, and the bundle check does not look at the helpers. Co-Authored-By: Claude Opus 5.5 --- ci/test_macos_browser_helpers.py | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 ci/test_macos_browser_helpers.py diff --git a/ci/test_macos_browser_helpers.py b/ci/test_macos_browser_helpers.py new file mode 100644 index 0000000000..96a702fc16 --- /dev/null +++ b/ci/test_macos_browser_helpers.py @@ -0,0 +1,113 @@ +#!/usr/bin/env -S uv run --script +"""The browser source's helper apps follow the app identity on macOS (#2386). + + uv run --no-project ci/test_macos_browser_helpers.py + +Chromium finds its helpers by the main executable's name: " Helper", +" Helper (GPU)", "(Plugin)" and "(Renderer)" in Contents/Frameworks. +obs-browser named them "OBS Helper" while the Rust brand's app is +"OBS-Studio-Rust", so the GPU process failed to launch (error_code=1003) and +adding a browser source crashed OBS. The helpers' bundle IDs follow the app's +bundle ID the same way (".helper", ".helper.gpu", ...). +""" + +from __future__ import annotations + +import importlib.util +import plistlib +import re +import tempfile +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +FLAVORS = (("", ""), (" (GPU)", ".gpu"), (" (Plugin)", ".plugin"), (" (Renderer)", ".renderer")) + + +def identities() -> dict[str, dict[str, str]]: + """OBS_MACOS_BUNDLE_NAME and _ID per brand, from cmake/common/app-identity.cmake.""" + text = (ROOT / "cmake/common/app-identity.cmake").read_text() + head, rust = text.split("if(OBS_BRAND_RUST)", 1) + rust = rust.split("endif()", 1)[0] + + def values(block: str) -> dict[str, str]: + return dict(re.findall(r"set\((OBS_MACOS_BUNDLE_(?:NAME|ID))\s+(\S+)\)", block)) + + upstream = values(head) + return {"upstream": upstream, "rust": {**upstream, **values(rust)}} + + +def browser_helpers(identity: dict[str, str]) -> list[tuple[str, str]]: + """(name, bundle id) of each helper that obs-browser's macOS CMake builds.""" + text = (ROOT / "plugins/obs-browser/cmake/os-macos.cmake").read_text() + name = re.search(r'set\(helper_output_name\s+"([^"]+)"\)', text).group(1) + bundle = re.search(r"XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER\s+(\S+)", text).group(1) + for var, value in identity.items(): + name = name.replace(f"${{{var}}}", value) + bundle = bundle.replace(f"${{{var}}}", value) + return [(name + suffix, bundle.replace("${helper_plist}", plist)) for suffix, plist in FLAVORS] + + +def load_identity_check(): + spec = importlib.util.spec_from_file_location("app_identity_check", ROOT / "ci/app_identity_check.py") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def write_bundle(root: Path, helper_name: str, helper_id: str) -> Path: + """A minimal OBS-Studio-Rust.app that check_bundle() accepts, with browser helpers.""" + check = load_identity_check() + app = root / "OBS-Studio-Rust.app" + (app / "Contents/MacOS").mkdir(parents=True) + (app / "Contents/MacOS/OBS-Studio-Rust").write_bytes(b"") + (app / "Contents/Frameworks/Sparkle.framework").mkdir(parents=True) + with (app / "Contents/Info.plist").open("wb") as stream: + plistlib.dump( + { + "CFBundleIdentifier": check.APP_ID, + "CFBundleExecutable": "OBS-Studio-Rust", + "CFBundleDisplayName": "OBS-Studio-Rust", + "SUFeedURL": f"{check.UPDATE_FEED_PREFIX}updates_arm64_v2.xml", + "SUPublicEDKey": check.SPARKLE_PUBLIC_KEY, + }, + stream, + ) + for suffix, plist in FLAVORS: + helper = app / f"Contents/Frameworks/{helper_name}{suffix}.app/Contents" + (helper / "MacOS").mkdir(parents=True) + (helper / f"MacOS/{helper_name}{suffix}").write_bytes(b"") + with (helper / "Info.plist").open("wb") as stream: + plistlib.dump({"CFBundleExecutable": f"{helper_name}{suffix}", "CFBundleIdentifier": helper_id + plist}, stream) + return app + + +class MacosBrowserHelpersTest(unittest.TestCase): + def test_helpers_follow_the_app_identity(self): + for brand, identity in identities().items(): + with self.subTest(brand=brand): + expected = [ + (f"{identity['OBS_MACOS_BUNDLE_NAME']} Helper{suffix}", f"{identity['OBS_MACOS_BUNDLE_ID']}.helper{plist}") + for suffix, plist in FLAVORS + ] + self.assertEqual(browser_helpers(identity), expected) + + def test_upstream_names_are_unchanged(self): + self.assertEqual(browser_helpers(identities()["upstream"])[0], ("OBS Helper", "com.obsproject.obs-studio.helper")) + + def test_bundle_check_rejects_upstream_helper_names(self): + check = load_identity_check() + with tempfile.TemporaryDirectory() as tmp: + app = write_bundle(Path(tmp), "OBS Helper", "com.obsproject.obs-studio.helper") + with self.assertRaisesRegex(RuntimeError, "Helper"): + check.check_bundle(app) + + def test_bundle_check_accepts_branded_helpers(self): + check = load_identity_check() + with tempfile.TemporaryDirectory() as tmp: + app = write_bundle(Path(tmp), "OBS-Studio-Rust Helper", f"{check.APP_ID}.helper") + check.check_bundle(app) + + +if __name__ == "__main__": + unittest.main() From 8504468b228dfbaed442ffeeec9750f5992d2fe8 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Sun, 25 Oct 2026 12:39:25 +0100 Subject: [PATCH 2/4] macos: Name the browser helpers after the app (#2386) app_identity_check.py's bundle check, which the release workflow runs on every macOS app, now checks the browser source's helper apps: when the app has any, they must be " Helper", "(GPU)", "(Plugin)" and "(Renderer)", with the bundle IDs ".helper", ".gpu", ".plugin" and ".renderer". The 2026-10-23 release fails it with its "OBS Helper" apps. plugins/obs-browser moves to obs-rust/obs-browser e513629, which names the helpers and their bundle IDs after obs-studio's app identity (OBS_MACOS_BUNDLE_NAME, OBS_MACOS_BUNDLE_ID). With it, Chromium finds the GPU helper and adding a browser source no longer crashes OBS on macOS. The source still stays black until #2387 is fixed. Co-Authored-By: Claude Opus 5.5 --- ci/app_identity_check.py | 24 ++++++++++++++++++++++++ docs/features.md | 6 ++++-- plugins/obs-browser | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ci/app_identity_check.py b/ci/app_identity_check.py index 8009c6763e..a2bbdbb07a 100644 --- a/ci/app_identity_check.py +++ b/ci/app_identity_check.py @@ -110,6 +110,30 @@ def check_bundle(root: Path) -> None: raise RuntimeError("packaged SUPublicEDKey is not obs-rust's Sparkle key") if not (root / "Contents/Frameworks/Sparkle.framework").is_dir(): raise RuntimeError("packaged app has an update feed but no Sparkle.framework") + check_browser_helpers(root, metadata["CFBundleExecutable"]) + + +# Chromium finds the browser source's helper apps by the main executable's +# name, and their bundle IDs follow the app's (#2386). +BROWSER_HELPER_FLAVORS = (("", ""), (" (GPU)", ".gpu"), (" (Plugin)", ".plugin"), (" (Renderer)", ".renderer")) + + +def check_browser_helpers(root: Path, executable: str) -> None: + frameworks = root / "Contents/Frameworks" + helpers = sorted(path.name for path in frameworks.glob("* Helper*.app")) + if not helpers: + return # built without the browser source + expected = {f"{executable} Helper{suffix}.app": f"{APP_ID}.helper{plist}" for suffix, plist in BROWSER_HELPER_FLAVORS} + if sorted(expected) != helpers: + raise RuntimeError(f"browser helpers are {helpers}, expected {sorted(expected)}: Chromium cannot launch them") + for name, bundle_id in expected.items(): + with (frameworks / name / "Contents/Info.plist").open("rb") as stream: + helper = plistlib.load(stream) + if helper.get("CFBundleExecutable") != name.removesuffix(".app") or helper.get("CFBundleIdentifier") != bundle_id: + raise RuntimeError( + f"browser helper {name} has executable {helper.get('CFBundleExecutable')!r} and bundle ID " + f"{helper.get('CFBundleIdentifier')!r}, expected {name.removesuffix('.app')!r} and {bundle_id!r}" + ) def main() -> None: diff --git a/docs/features.md b/docs/features.md index 5e4e92c6bd..b4de5e1a36 100644 --- a/docs/features.md +++ b/docs/features.md @@ -405,11 +405,13 @@ not get a line. version it is based on, in the window title, log, About dialog, `--version` and package metadata. On first run it copies the upstream OBS settings without changing them. Plugins still see a valid OBS version. - *All*, 2026-10-10. Issues + On macOS the browser source's helper apps take the app's name too, so + adding a browser source no longer crashes OBS. *All*, 2026-10-10. Issues [#111](https://github.com/obs-rust/obs-studio/issues/111), [#631](https://github.com/obs-rust/obs-studio/issues/631), [#632](https://github.com/obs-rust/obs-studio/issues/632), - [#1087](https://github.com/obs-rust/obs-studio/issues/1087), PRs + [#1087](https://github.com/obs-rust/obs-studio/issues/1087), + [#2386](https://github.com/obs-rust/obs-studio/issues/2386), PRs [#67](https://github.com/obs-rust/obs-studio/pull/67), [#112](https://github.com/obs-rust/obs-studio/pull/112), [#510](https://github.com/obs-rust/obs-studio/pull/510), diff --git a/plugins/obs-browser b/plugins/obs-browser index 4583599fe8..e513629da7 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit 4583599fe86df1bcb28aca1fd96ea92c269373cf +Subproject commit e513629da741119370f763f2b5b6e991f6c16784 From 98a7cd7b5da5d838c2fcfad4452281092f327828 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Sun, 25 Oct 2026 13:08:09 +0100 Subject: [PATCH 3/4] ci: Skip the obs-browser source checks without the submodule (#2386) The Format job checks out no submodules, so test_macos_browser_helpers.py failed there with FileNotFoundError on plugins/obs-browser/cmake/ os-macos.cmake. The two checks that read that file now skip with the reason when the submodule is not checked out. The two bundle checks still run there, and the release workflow runs app_identity_check.py on every built macOS app. Co-Authored-By: Claude Opus 5.5 --- ci/test_macos_browser_helpers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/test_macos_browser_helpers.py b/ci/test_macos_browser_helpers.py index 96a702fc16..91f610fe12 100644 --- a/ci/test_macos_browser_helpers.py +++ b/ci/test_macos_browser_helpers.py @@ -21,6 +21,11 @@ from pathlib import Path ROOT = Path(__file__).resolve().parent.parent +BROWSER_CMAKE = ROOT / "plugins/obs-browser/cmake/os-macos.cmake" +# Jobs that check out no submodules (the Format job) skip the source checks; +# the bundle checks below still run, and the release workflow runs +# app_identity_check.py on every built macOS app. +NEEDS_BROWSER = unittest.skipUnless(BROWSER_CMAKE.is_file(), "plugins/obs-browser is not checked out") FLAVORS = (("", ""), (" (GPU)", ".gpu"), (" (Plugin)", ".plugin"), (" (Renderer)", ".renderer")) @@ -39,7 +44,7 @@ def values(block: str) -> dict[str, str]: def browser_helpers(identity: dict[str, str]) -> list[tuple[str, str]]: """(name, bundle id) of each helper that obs-browser's macOS CMake builds.""" - text = (ROOT / "plugins/obs-browser/cmake/os-macos.cmake").read_text() + text = BROWSER_CMAKE.read_text() name = re.search(r'set\(helper_output_name\s+"([^"]+)"\)', text).group(1) bundle = re.search(r"XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER\s+(\S+)", text).group(1) for var, value in identity.items(): @@ -83,6 +88,7 @@ def write_bundle(root: Path, helper_name: str, helper_id: str) -> Path: class MacosBrowserHelpersTest(unittest.TestCase): + @NEEDS_BROWSER def test_helpers_follow_the_app_identity(self): for brand, identity in identities().items(): with self.subTest(brand=brand): @@ -92,6 +98,7 @@ def test_helpers_follow_the_app_identity(self): ] self.assertEqual(browser_helpers(identity), expected) + @NEEDS_BROWSER def test_upstream_names_are_unchanged(self): self.assertEqual(browser_helpers(identities()["upstream"])[0], ("OBS Helper", "com.obsproject.obs-studio.helper")) From 64a6680c7c3d11e90a45fa27617605453ff40d64 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Sun, 25 Oct 2026 13:14:44 +0100 Subject: [PATCH 4/4] obs-browser: Update to 9aa4a60 (macOS helper names, CEF on the main thread) Moves plugins/obs-browser from the head of obs-rust/obs-browser#9 (e513629, the same tree as its merge 1412f26) to master 9aa4a60, which adds obs-rust/obs-browser#10: with the Qt loop (macOS), obs_browser_initialize() runs BrowserInit() on the Qt main thread when it is called from another thread, so a first browser source created by obs-websocket renders (#2387). 9aa4a60 has the tree of the branch tested on macOS 26.7.1 (first source through obs-websocket renders 3 of 3, the scene-collection control too). docs/features.md gets the #2387 line (fixed upstream bugs, sources) and the PR links for both. Co-Authored-By: Claude Opus 5.5 --- docs/features.md | 11 ++++++++++- plugins/obs-browser | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/features.md b/docs/features.md index b4de5e1a36..dfbad2ebb7 100644 --- a/docs/features.md +++ b/docs/features.md @@ -418,7 +418,9 @@ not get a line. [#515](https://github.com/obs-rust/obs-studio/pull/515), [#657](https://github.com/obs-rust/obs-studio/pull/657), [#706](https://github.com/obs-rust/obs-studio/pull/706), - [#1088](https://github.com/obs-rust/obs-studio/pull/1088). + [#1088](https://github.com/obs-rust/obs-studio/pull/1088), + [#2390](https://github.com/obs-rust/obs-studio/pull/2390), + [obs-rust/obs-browser#9](https://github.com/obs-rust/obs-browser/pull/9). - **Daily beta packages.** A beta is published every day as the latest release: an AppImage for Linux, zips for Windows x64 (with the Visual C++ runtime) and ARM64, and DMGs for Apple silicon and Intel Macs. *All*, @@ -1553,6 +1555,13 @@ area. own goes away. *Linux*, 2026-10-25. Issue [#2261](https://github.com/obs-rust/obs-studio/issues/2261), upstream [obsproject/obs-studio#5502](https://github.com/obsproject/obs-studio/issues/5502). +- On macOS, a first browser source created by obs-websocket (`CreateInput`) + renders. Before, CEF started on obs-websocket's thread, and no browser + source rendered for the rest of the session, also ones added in the UI + later. *macOS*, pending merge. Issue + [#2387](https://github.com/obs-rust/obs-studio/issues/2387), PRs + [#2390](https://github.com/obs-rust/obs-studio/pull/2390), + [obs-rust/obs-browser#10](https://github.com/obs-rust/obs-browser/pull/10). ### Scenes and UI diff --git a/plugins/obs-browser b/plugins/obs-browser index e513629da7..9aa4a60440 160000 --- a/plugins/obs-browser +++ b/plugins/obs-browser @@ -1 +1 @@ -Subproject commit e513629da741119370f763f2b5b6e991f6c16784 +Subproject commit 9aa4a60440a245e5d1aed3219365a894b19a0008