Repository navigation
ci: Add AppImage build - #221
Conversation
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
|
Thanks, this is a useful addition. Review notes: Must change
Worth knowing (non-blocking)
Process: this adds a new workflow file, and the project rule ( |
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
|
Thanks. |
|
How's musl compatibility? I'm thinking we should file a bug to migrate to musl |
|
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:
A process can only load shared objects built against its own libc (different TLS model, 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 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 |
|
omg |
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.