Skip to content

ci: Add AppImage build - #221

Merged
zackees merged 2 commits into
obs-rust:masterfrom
probonopd:infra/appimage
Oct 11, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
probonopd:infra/appimage

Conversation

@probonopd

@probonopd probonopd commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #91

Build OBS-Studio-Rust as an AppImage and prove that it runs on other Linux distributions, so that users of any distribution can run the same binaries without installing OBS or its dependencies.

The AppDir bundles every library OBS needs, including glibc and its dynamic loader, so that it works on distributions older and newer than the build host. Only the GPU and hardware video drivers (Mesa, NVIDIA, VA-API) come from the host. Executables point at the bundled loader through a fixed path that AppRun installs on start. Bundled ELF files carry relative RPATHs instead of relying on LD_LIBRARY_PATH, which would leak into every process OBS starts and crash host programs that then load the newer glibc. Qt is pinned to the bundled plugins (a host Qt plugin of a different version crashed OBS), and the Qt SVG plugins are required to be present at build time.

The resulting AppImage is started headless in stock Debian, Ubuntu and Fedora containers that have none of OBS's dependencies installed. The test fails unless an OBS window appears and renders, the core stack is loaded from inside the AppImage, no Qt plugin comes from the host, and, for a build with ENABLE_RUST_LIBOBS, obs --version reports OBS-Studio-Rust. The Debian container deliberately has its own Qt SVG plugins installed.

If OBS crashes, AppRun writes a report to
~/.cache/obs-studio-appimage-crash.txt and, when gdb is installed and the crash happened right after start, reruns OBS under gdb to add a backtrace to it. OBS_APPIMAGE_DEBUG=1 prints the environment and a backtrace on demand.

The browser source, VLC, WebRTC, AJA, Python scripting and the Intel QSV plugin are not part of the AppImage. QSV probes the Intel GPU through the host's libvpl runtime at startup, which no CI runner can exercise, so it is opt-in through the workflow's "qsv" input.

Build OBS-Studio-Rust as an AppImage and prove that it runs on other
Linux distributions, so that users of any distribution can run the same
binaries without installing OBS or its dependencies.

The AppDir bundles every library OBS needs, including glibc and its
dynamic loader, so that it works on distributions older and newer than
the build host. Only the GPU and hardware video drivers (Mesa, NVIDIA,
VA-API) come from the host. Executables point at the bundled loader
through a fixed path that AppRun installs on start. Bundled ELF files
carry relative RPATHs instead of relying on LD_LIBRARY_PATH, which
would leak into every process OBS starts and crash host programs that
then load the newer glibc. Qt is pinned to the bundled plugins (a host
Qt plugin of a different version crashed OBS), and the Qt SVG plugins
are required to be present at build time.

The resulting AppImage is started headless in stock Debian, Ubuntu and
Fedora containers that have none of OBS's dependencies installed. The
test fails unless an OBS window appears and renders, the core stack is
loaded from inside the AppImage, no Qt plugin comes from the host, and,
for a build with ENABLE_RUST_LIBOBS, obs --version reports
OBS-Studio-Rust. The Debian container deliberately has its own Qt SVG
plugins installed.

If OBS crashes, AppRun writes a report to
~/.cache/obs-studio-appimage-crash.txt and, when gdb is installed and
the crash happened right after start, reruns OBS under gdb to add a
backtrace to it. OBS_APPIMAGE_DEBUG=1 prints the environment and a
backtrace on demand.

The browser source, VLC, WebRTC, AJA, Python scripting and the Intel
QSV plugin are not part of the AppImage. QSV probes the Intel GPU
through the host's libvpl runtime at startup, which no CI runner can
exercise, so it is opt-in through the workflow's "qsv" input.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01S5G4JBbjZNccbWZqMwNLRC
@zackees

zackees commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks, this is a useful addition. Review notes:

Must change

  1. .github/workflows/appimage.yaml:175 downloads appimagetool from the continuous release with no checksum. Its output becomes the release artifact, so it's a moving, unverified dependency. Please pin a tagged release URL and check its sha256sum -c before running it, the same way every uses: here is pinned by SHA.

Worth knowing (non-blocking)

  • The loader lives at a fixed /tmp/.obs-rust-appimage-<hash>/. The ownership and mode checks and the post-install hash compare in AppRun are sound: it refuses rather than running an untrusted loader. On a multi-user machine, though, the first user owns that path and every other user gets cannot set up the bundled loader. Using ${XDG_RUNTIME_DIR:-/tmp} isn't possible because PT_INTERP has to be fixed. A per-uid path baked in at build time can't work either, so documenting this limit in the README seems fine.
  • test-appimage.sh is the regression test here, run in stock distro containers. That's the right shape for packaging.

Process: this adds a new workflow file, and the project rule (AGENTS.md) needs explicit maintainer sign-off for that, so I'll leave the merge to @zackees. I've only reviewed it.

Download a tagged appimagetool release (1.9.1) instead of the rolling
"continuous" build and verify it with sha256sum -c, like the other
third-party code the workflow runs is pinned. A changed or tampered
download now fails the build.

Add build-aux/appimage/README.md describing how the AppImage works and
its limitations, in particular that the bundled loader lives at a fixed
path under /tmp, so only the first user on a machine can run a given
build, and that /tmp must allow executing files.

Review comment: obs-rust#221 (comment)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01S5G4JBbjZNccbWZqMwNLRC
@zackees

zackees commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks. 2e9385788 resolves the must-change: appimagetool is pinned to 1.9.1 and verified with sha256sum -c. I downloaded that release myself and got ed4ce84f…eb0, which matches. No remaining review concerns from me. The merge is waiting on maintainer sign-off for the new workflow file.

@zackees

zackees commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

How's musl compatibility?

I'm thinking we should file a bug to migrate to musl

@probonopd

Copy link
Copy Markdown
Contributor Author

While using musl libc has many advantages, there is a consideration for OBS especially: The libc we bundle has to match the libc of the host's GPU drivers, and that is glibc on every host that has NVIDIA or hardware encoding. A musl build would lose those, and the only hosts it would gain (musl distros) are covered more cheaply by bundling Mesa into the glibc build.

Everything else is bundled, but the GPU userspace has to come from the host because it must match the installed GPU and kernel driver, and OpenGL contexts live in-process:

  • Mesa (libGL/libEGL/libGLX and the dlopened Gallium drivers iris_dri.so, radeonsi_dri.so, ...)
  • NVIDIA proprietary (libGLX_nvidia, libnvidia-glcore, libcuda, libnvidia-encode for NVENC)
  • VA-API drivers (iHD_drv_video.so, radeonsi_drv_video.so, nvidia-vaapi-driver), AMD AMF (libamfrt64.so), Vulkan ICDs, Intel's libvpl runtime for QSV

A process can only load shared objects built against its own libc (different TLS model, errno, FILE, pthread layouts, symbol versioning). On glibc hosts, which is every mainstream desktop distribution, all of the above is glibc. There is no musl build of the NVIDIA userspace at all, and no musl build of the Intel/AMD proprietary encoders. gcompat only runs glibc executables on Alpine; it cannot host Mesa or the NVIDIA blobs inside a musl process.

On glibc hosts: no host Mesa, no NVIDIA rendering, no NVENC, no VA-API, no AMF, no QSV. It would have to bundle its own musl Mesa and render with that, with software encoding only. For a recording/streaming app that is a strict subset of the glibc variant, not a second flavour.

On musl hosts (Alpine, Void-musl, Chimera, postmarketOS): it would work with the host's musl Mesa, and that is the only place it is better than the current build, because the current glibc build cannot load a musl Mesa and so has no OpenGL there.

So: two AppImages?

No. The gap on musl hosts is "no usable Mesa", not "wrong libc", and the fix for that is orthogonal to the libc choice: a glibc build that also bundles Mesa's open drivers (used as a fallback when the host GL fails to initialise) talks to the kernel directly over DRM and works on musl hosts too, while still using the host's NVIDIA/VA-API/AMF stack everywhere else. musl hosts have no proprietary GPU stack anyway, so the open drivers are all there is to support there. One AppImage, one libc, optional bundled Mesa fallback.

That fallback is not free (Mesa plus libLLVM is roughly 100 MB, and the bundled drivers go stale for new GPUs), and musl desktop hosts are a small share of OBS users, so I'd treat it as a separate follow-up if someone actually asks for it; nothing for this PR.

For completeness, musl would not simplify the AppImage either: OBS is a plugin host, so the build would still be dynamic musl with the same bundled-loader arrangement as now. The code itself builds on musl (Alpine packages obs-studio; Rust has a musl target), so this is a drivers question, not a portability one.

@zackees

zackees commented Oct 11, 2026

Copy link
Copy Markdown
Member

omg

@zackees
zackees merged commit ecdb3fc into obs-rust:master Oct 11, 2026
27 checks passed
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.

Support app image

2 participants