Skip to content

frontend: The AppImage loads no plugins from the host's system directories - #1227

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-host-plugins
Oct 17, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-host-plugins

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1084

What and why

The AppImage loads only its own modules and the user's plugins. It no longer loads the plugins of a distribution's OBS installed on the same machine.

  • The Linux plugin loader (frontend/plugin-manager/PluginModuleLoader_Linux.cpp) takes its system plugin locations from the build's install prefix: <prefix>/<libdir>/obs-studio-rust/obs-modules/plugins, and the legacy <prefix>/<libdir>/obs-plugins (frontend/cmake/feature-plugin-manager.cmake). The AppImage is configured with CMAKE_INSTALL_PREFIX=/usr and CMAKE_INSTALL_LIBDIR=lib, so it scanned /usr/lib/obs-plugins. That is where Arch's obs-studio package installs its plugins, which are built against its own libobs.
  • This is older than the glibc 2.28 base. On an Arch host with obs-studio 32.2.2 installed, 0.1.0-beta.20261014 (Ubuntu base) loads linux-jack.so, obs-libfdk.so, obs-qsv11.so and obs-webrtc.so from there without a word, because they happen to load against its libraries. Master's AppImage loads the first three too, and obs-webrtc.so fails (/usr/lib/libbrotlienc.so.1: undefined symbol: BrotliDefaultAllocFunc). OBS then waits at the "Plugin Errors" dialog, and SIGTERM doesn't quit it.
  • In a relocatable build (ENABLE_RELOCATABLE, which only the AppImage sets), the system locations are now relative to the executable, the way its core modules are (libobs/obs-core-modules-loader-nix.c.h). systemPath() resolves them with os_get_executable_path_ptr(), so they point into the AppImage's own tree (usr/lib/obs-studio-rust/obs-modules/plugins, usr/lib/obs-plugins). Neither exists there, so nothing is loaded from them.
  • The user's plugin folders are unchanged: $XDG_DATA_HOME/obs-studio/plugins, the legacy $XDG_CONFIG_HOME/obs-studio/plugins, and OBS_PLUGINS_PATH / OBS_LEGACY_PLUGINS_PATH.
  • Installed builds (.deb, AUR, Flatpak, macOS, Windows) don't set ENABLE_RELOCATABLE. They keep their absolute paths, and their binaries don't change.

RED → GREEN

  • RED commit: 2213263 test: test-appimage.sh requires the AppImage to skip the host's OBS plugins. In the saved-profile scenario, every system plugin directory a distribution OBS or an installed OBS-Studio-Rust uses gets a file that no OBS can load: <lib>/obs-plugins, <lib>/obs-modules/plugins and <lib>/obs-studio-rust/obs-modules/plugins, for /usr/lib, /usr/lib64 and /usr/lib/x86_64-linux-gnu. OBS must not mention that file. Copies of the bundled obs-transitions.so in both user plugin folders, under names of their own, must be in "Loaded Modules". On master's AppImage it fails on Arch and on Ubuntu 22.04:

    • OBS tried to load plugins of the host's own OBS from its system directories (Failed to load module file '/usr/lib/obs-plugins/host-plugin-probe.so' and '/usr/lib/obs-studio-rust/obs-modules/plugins/host-plugin-probe.so');
    • then did not quit within 30 s of SIGINT: the Plugin Errors dialog.

    The user-plugin checks pass on master as well.

  • GREEN: 969e48f. The local runs below were on 040b9c49c, the same two commits before a clean rebase onto current master. saved-profile passes on Arch (verify-recording.sh: screen and camera move, 440 Hz tone throughout) and on Ubuntu 22.04 (launch-only, as in CI). The log has no probe line, and user-plugin-probe.so and user-legacy-plugin-probe.so are loaded. clang-format 22.1.3, gersemi 0.25.0 and ci/platform_ifdef_ratchet.py are clean, and shellcheck reports nothing new.

  • The whole CI test matrix ran locally on this branch's AppImage: every scenario of test-appimage.sh (bundle, first-start, probes, saved-profile, saved-profile-custom, saved-profile-existing) passes on Arch and on Ubuntu 22.04, 12 of 12. verify-recording.sh passes on every Arch recording.

  • Real app: A/B on an Arch host with the distribution's obs-studio 32.2.2 installed, master's AppImage (A) against this branch's (B), see below.

A/B on an Arch host with the distribution's obs-studio 32.2.2 installed. A is master's AppImage, B is this branch's. Each run had a fresh HOME, a private Xvfb and D-Bus, and ulimit -c 0.

Check A: master B: this branch
First start (fresh HOME) main window plus "Plugin Errors" dialog. Still running 15 s after SIGTERM main window, no dialog. Quits on SIGTERM
Plugin list ("Loaded Modules") 21: the 18 bundled plus linux-jack, obs-libfdk, obs-qsv11, mapped from /usr/lib/obs-plugins. obs-webrtc.so failed to load the 18 bundled. Nothing mapped from /usr/lib/obs-plugins
Saved profile, --startrecording (640x360 x264, mkv) AAC encoder libfdk_aac, from the host's obs-libfdk.so. OBS had to be killed and the file was left unfinished AAC encoder ffmpeg_aac (bundled). 14.5 s file, finalized, 0 decode errors
release-check 00-smoke (websocket, SIGTERM quit, clean shutdown) FAIL: still running 20 s after SIGTERM, no "Number of memory leaks" line PASS
HTTPS services update fails (#1085, not touched here) fails, same

The same host with 0.1.0-beta.20261014 (Ubuntu base) shows no dialog, but it loads linux-jack, obs-libfdk, obs-qsv11 and obs-webrtc from /usr/lib/obs-plugins.

How it ran: both AppImages were built the way the workflow builds them (build.py --base manylinux, all steps). There was no container runtime, so the build ran in the digest-pinned manylinux_2_28 image, unpacked, with the RUN steps of build-aux/appimage/manylinux/Dockerfile applied, under a user namespace. test-appimage.sh ran in stock ubuntu:22.04 and archlinux:latest root filesystems, a fresh copy for each scenario, under a user namespace with its own network namespace (loopback only). Their test packages were installed beforehand, so the script's apt-get update / pacman -Sy were skipped. The A/B runs used a private Xvfb, dbus-run-session, a fresh HOME per run and ulimit -c 0. AlmaLinux 8 (bundle and first-start only) was not run locally.

Note: the CA bundle fix for #1085 (a PR to follow) edits the same places in test-appimage.sh and build-aux/appimage/README.md. Whichever merges second needs a small rebase there.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not a port

AI note: Claude Code (Claude Opus 5.5) wrote the code, the tests, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

CI note: this PR changes build-aux/appimage, and "AppImage Changes" set changed=1, but the AppImage 📦 job was skipped. That job is what runs test-appimage.sh, so the new test hasn't run in CI yet.

The cause is "CI Pre 🧹 / Cache Janitor 🧹", which failed first: DELETE .../actions/caches/9088288106 failed: HTTP Error 403: Forbidden. A pull_request run from a fork gets a read-only GITHUB_TOKEN whatever the job's permissions: say. So the janitor can't delete caches there, exits 1, and every job that needs ci-pre without !cancelled() is skipped. Same-repo branches (e.g. feat/1023-drm-fdinfo) pass the janitor. #1136's Windows 🪟 build was skipped the same way.

I haven't touched CI. Could the AppImage job be re-run on this PR some other way, for example after the janitor is skipped or made non-fatal for fork PRs? The local runs (12 of 12) are in the description.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Good catch, thanks. appimage was the only job after ci-pre without !cancelled(), so the janitor's 403 on fork tokens skipped it. Fix in #1229 (queued). Once it lands I'll rebase this PR so AppImage 📦 runs test-appimage.sh here, and queue it if that passes.

chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 17, 2026
…-rust#1229)

A fork PR's GITHUB_TOKEN is read-only, so CI Pre's cache janitor fails
there. Every other job after it has !cancelled(); appimage did not, so
its implicit success() skipped it and test-appimage.sh never ran on a
fork PR that changes build-aux/appimage (reported on obs-rust#1227).
@zackees
zackees force-pushed the fix/appimage-host-plugins branch from 969e48f to 566cdcc Compare October 17, 2026 12:01
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

#1229 merged; rebased this onto master (no conflicts, same two commits) so AppImage 📦 now runs test-appimage.sh here. Will queue once it's green.

@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for #1229. The AppImage now builds here (Build AppImage 🧱 passed), but test-appimage.sh still doesn't run. In appimage.yaml, test and test-nixos have if: github.event_name == 'push' || inputs.platform_tests, so on a PR both are skipped by design ("never in PR CI: only when a release is being made").

So for this PR, the only test-appimage.sh results are the local ones in the description: 12 of 12 on Arch and Ubuntu 22.04, and AlmaLinux 8 not run. If you'd like a CI run before merging, a workflow_dispatch of appimage.yaml with platform_tests: true would do it. Dispatch needs a ref in obs-rust, so this head would have to be pushed to a branch there first. Otherwise the next release's gate will run it.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Thanks, you're right about the platform tests. Pushed this head (566cdcc) to verify/pr-1227 and dispatched appimage.yaml with platform_tests: true: https://github.com/obs-rust/obs-studio/actions/runs/39032199337. I'll queue this PR if test and test-nixos pass there.

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

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Platform tests passed on 566cdcc (Arch, Ubuntu 22.04, AlmaLinux 8, NixOS): https://github.com/obs-rust/obs-studio/actions/runs/39032199337. Queued.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 17, 2026
rdoupe and others added 2 commits October 17, 2026 06:11
…lugins (RED, Refs obs-rust#1084)

saved-profile: every system directory where a distribution OBS or an
installed OBS-Studio-Rust keeps plugins (<lib>/obs-plugins,
<lib>/obs-modules/plugins and <lib>/obs-studio-rust/obs-modules/plugins, for
/usr/lib, /usr/lib64 and /usr/lib/x86_64-linux-gnu) gets a file that no OBS
can load. OBS must not mention it. Copies of the bundled obs-transitions.so
in the user's plugin folders, $XDG_DATA_HOME/obs-studio/plugins/<name>/ and
the legacy $XDG_CONFIG_HOME/obs-studio/plugins/<name>/bin/64bit/, must be in
"Loaded Modules".

Fails on master's AppImage: the legacy system path is the build's install
prefix, /usr/lib/obs-plugins, so OBS tries the probe there, then waits at the
"Plugin Errors" dialog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ories (GREEN, Fixes obs-rust#1084)

The Linux plugin loader's system locations come from the build's install
prefix: <prefix>/<libdir>/obs-studio-rust/obs-modules/plugins and the legacy
<prefix>/<libdir>/obs-plugins. The AppImage is configured with prefix /usr and
libdir lib, so it loaded whatever a distribution's OBS keeps in
/usr/lib/obs-plugins, built against that distribution's libobs. On Arch with
obs-studio installed, 0.1.0-beta.20261014 loaded linux-jack, obs-libfdk,
obs-qsv11 and obs-webrtc from there. On master, obs-webrtc.so fails to load,
and OBS waits at the "Plugin Errors" dialog, where SIGTERM does not quit it.

In a relocatable build (ENABLE_RELOCATABLE, which only the AppImage sets) the
system locations are now relative to the executable, the way its core
modules are, so they point into the AppImage's own tree. The user's plugin
folders ($XDG_DATA_HOME/obs-studio/plugins, the legacy
$XDG_CONFIG_HOME/obs-studio/plugins and OBS_PLUGINS_PATH) are unchanged.
Installed builds keep their absolute paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees force-pushed the fix/appimage-host-plugins branch from 566cdcc to e59432b Compare October 17, 2026 13:11
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

This left the queue after #1242 moved the frontend into unity groups (PluginModuleLoader_Linux.cpp is now .cpp.hpp). Rebased onto master: git carried your change through the rename, the group's PCH already includes util/platform.h, and systemPath doesn't clash with anything else in the group. Pushed e59432b; I'll re-queue once CI is green. Nit for a follow-up: the comment in feature-plugin-manager.cmake still says PluginModuleLoader_Linux.cpp.

@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into obs-rust:master with commit bbf55a0 Oct 17, 2026
26 of 27 checks passed
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 17, 2026
…ent (obs-rust#1251)

obs-rust#1242 moved the frontend into unity groups and renamed
PluginModuleLoader_Linux.cpp to PluginModuleLoader_Linux.cpp.hpp. The
comment that obs-rust#1227 added to feature-plugin-manager.cmake still named the
old file. Comment only; no build change.

Refs obs-rust#1084

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

bug: AppImage (glibc 2.28 base): loads OBS plugins from the host's /usr/lib/obs-plugins, then blocks on a "could not load plugins" dialog

2 participants