Skip to content

build-aux: Bundle PipeWire in the AppImage and test it with a saved profile - #437

Merged
zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-pipewire
Oct 13, 2026
Merged

zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-pipewire

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Every published AppImage (continuous and the dated beta) crashed on start for anyone whose scene holds a Screen Capture (PipeWire) source: AppRun points the bundled libpipewire at module and config directories that were never bundled, pw_context_new() returned NULL and the next call segfaulted (#426). #429 made OBS survive that; this PR bundles PipeWire completely and makes the release tests launch what users run, so a build like that can't be published again.

  1. ci: Test the AppImage with a saved PipeWire profile (RED): test-appimage.sh takes one scenario, and CI runs each in its own fresh stock container (Debian 13, Ubuntu 22.04, Fedora):
    • bundle: every path AppRun exports exists (check-appdir.sh), every bundled ELF resolves its libraries and symbols from the bundle, and every module the build installed is present. No desktop-session package is installed in this scenario.
    • first-start: a new profile opens a window that renders, then OBS has to quit on SIGINT with status 0.
    • probes: a helper (testkit.c) run in AppRun's environment with the bundled loader talks to PipeWire, PulseAudio, gconv and D-Bus.
    • saved-profile: a returning user's scene with a PipeWire screen capture, a PipeWire camera and a PulseAudio microphone, against a private D-Bus, PipeWire, WirePlumber and pipewire-pulse, a fake ScreenCast/Camera portal and test producers. OBS records with --startrecording, and verify-recording.sh checks the picture moves and the 440 Hz tone is there. Only Ubuntu 22.04 (PipeWire 0.3.x can't run the producers) runs it without them, and OBS must still get its PipeWire connection from the portal, stay up and quit cleanly. An unreadable or old PipeWire anywhere else fails.
    • Every scenario fails if anything it started is still running afterwards, if an OBS instance socket is still open, or if AppRun saved a crash report. AppRun restarts a crashed OBS under gdb, which hid crashes from the old test.
    • The daily beta (release-rust.yaml) only takes the AppImage artifact when the AppImage workflow passed. continuous already waits for every test job.
  2. build-aux: Bundle PipeWire's modules and client.conf in the AppImage (GREEN): the build host installs libpipewire-0.3-modules and pipewire-bin, and assemble-appdir.sh fails if any directory AppRun exports is missing instead of skipping it.
  3. AGENTS.md: packaging changes need the real-profile launch test.

Motivation and Context

Fixes #426

How Has This Been Tested?

Every scenario in a fresh container on Debian 13, Ubuntu 22.04 and Fedora 44 (locally in rootless copies of the same images; in CI, below):

AppImage bundle first-start probes saved-profile
published continuous f44de6ee6 fail (missing paths) pass fail fail: OBS crashed (all 3 distros)
master 7ddbbb5b5 (#429, old packaging) fail pass fail fail cleanly, no crash (capture and camera never stream); Ubuntu 22.04 passes launch-only
this PR (CI artifact g6df26d562) pass pass pass pass; recording verified on Debian and Fedora
  • The CI artifact of this PR was run on a real desktop (Arch Linux, Hyprland, PipeWire 1.6.8) with an existing profile holding Screen Capture sources: no crash, and the screen capture reaches streaming.
  • Still to look at, not part of this PR: on that desktop, the DMA-BUF import fails (Cannot create EGLImage, OBS falls back to shared memory) and VAAPI doesn't initialize. Both point at the host GPU driver loading next to the bundled libraries, follow-up 2 in bug: AppImage: releases crash on launch when a scene has a PipeWire screen capture #426.
  • CI time of the AppImage workflow on this PR: build about 4 min (4m20s), then each distribution runs its four scenarios in about 3 min (Debian 3m11s), in parallel. Once ci: Move Flatpak and the native builds into the release gate #440 lands it runs on the daily release, tags and packaging PRs, not on every master push.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, 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 13, 2026

Copy link
Copy Markdown
Collaborator Author

Please do not merge this yet, even once CI passes. This run measures how long the new AppImage scenarios take on GitHub runners, so we can cut that time before it becomes the release gate. A ready version, rebased on master after #429, will follow.

rdoupe and others added 3 commits October 12, 2026 23:27
Every published AppImage crashed on start for anyone whose scene holds a
PipeWire screen capture: the bundled libpipewire was pointed at module and
config directories that were never bundled, pw_context_new() returned NULL
and the next PipeWire call segfaulted (obs-rust#429 now turns that into a dead
source). The AppImage test passed anyway: it only started OBS once with an
empty profile, where nothing touches PipeWire, so the broken build was
published.

test-appimage.sh now takes one scenario, and CI runs each in its own fresh
stock container, so nothing one scenario starts or leaves behind can affect
another:

1. bundle: check-appdir.sh requires every path AppRun exports into the
   AppDir to exist, PipeWire's client.conf with the modules and SPA plugins
   it loads, gconv and Qt's X11 and Wayland plugins; every bundled ELF
   file must resolve its libraries and symbols from the bundle with the
   bundled loader, and every module the build installed must be there. No
   desktop-session package is installed in this scenario.
2. first-start: a new profile opens a window that renders, then OBS must
   quit on SIGINT, by itself, with status 0.
3. probes: a test helper (testkit.c, built next to the AppImage and run
   next to obs with the same RPATH and AppRun's environment) connects to
   PipeWire and PulseAudio, converts text through gconv and uses the
   session bus.
4. saved-profile: OBS starts with a returning user's scene (PipeWire
   screen capture, PipeWire camera, PulseAudio microphone) and
   --startrecording, against a private D-Bus, PipeWire, WirePlumber and
   pipewire-pulse, a fake ScreenCast/Camera portal served by the helper,
   and test producers (colour bars, a bouncing ball, a 440 Hz tone). OBS
   must get its PipeWire connection from the portal, stay up, map
   PipeWire, PulseAudio and GLib from the AppImage, load every module the
   build installed, start every source and quit cleanly.
   verify-recording.sh then checks, outside the container, that the
   recording decodes at 320x240 with enough frames, both pictures keep
   moving and the tone is there throughout; its --self-test proves it
   fails on a frozen picture, a silent microphone and a broken file.
   Only Ubuntu 22.04, whose PipeWire 0.3.x cannot run the producers, runs
   it without them; an unreadable or old PipeWire anywhere else fails.

Every scenario ends by stopping what it started and fails if any of it,
or any OBS, is still running 10 s later or an OBS instance socket is still
open. AppRun hides a crash from its caller (it saves a report and starts
OBS again under gdb), so any AppRun crash report fails the scenario too.
The test only signals processes it started, picks a free X display and
clears the caller's session variables first.

The daily beta (release-rust.yaml) took the AppImage artifact even when
its tests had failed; it now takes it only when the appimage workflow
passed. The continuous release already waits for every test job.

Refs obs-rust#426

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…(GREEN)

AppRun points the bundled libpipewire at usr/lib/pipewire-0.3 and
usr/share/pipewire, but the build host had neither: the CI installs only
libpipewire-0.3-dev, and assemble-appdir.sh skipped missing directories
silently. Without client.conf, pw_context_new() returns NULL and OBS
crashes as soon as a PipeWire capture starts.

Install libpipewire-0.3-modules and pipewire-bin (which ships client.conf
on Ubuntu 26.04) on the build host, copy the SPA plugins, the modules and
the client configuration unconditionally, and fail the build when one of
them is missing. assemble-appdir.sh also runs check-appdir.sh, so any path
AppRun exports that is not in the AppDir now fails the build instead of a
user's start.

Fixes obs-rust#426

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A packaging change has to be covered by a test that runs the packaged
artifact the way a user does, with a saved profile that holds the sources
users depend on, and has to be shown failing without the change. A first
start with an empty profile let obs-rust#426 ship.

Refs obs-rust#426

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe
rdoupe force-pushed the fix/appimage-pipewire branch from ce2ed54 to 1956d9f Compare October 13, 2026 03:27
@rdoupe rdoupe changed the title build-aux: Bundle PipeWire in the AppImage and test it with a saved profile (do not merge: timing CI) build-aux: Bundle PipeWire in the AppImage and test it with a saved profile Oct 13, 2026
@rdoupe

rdoupe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review: the do-not-merge note above no longer applies. The CI times are in the description, and the CI-built AppImage from this PR has been run on a real desktop with Screen Capture sources: no crash.

@rdoupe
rdoupe marked this pull request as ready for review October 13, 2026 03:51
@zackees

zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Demonstrated RED→GREEN in CI. I pushed the RED commit bf7fac3 alone to a temporary branch and dispatched appimage.yaml (run 38343881775):

  • RED: the build passed, and the Debian 13, Ubuntu 22.04 and Fedora test jobs all failed. check-appdir reported that PIPEWIRE_MODULE_DIR (usr/lib/pipewire-0.3) is not in the AppImage, that client.conf is not bundled, and that libpipewire-module-protocol-native.so, -client-node.so and -adapter.so are missing, which is exactly the bug: AppImage: releases crash on launch when a scene has a PipeWire screen capture #426 crash.
  • GREEN: at 1956d9f, the PR's own run 38341795506 passed the build and all three distributions (bundle, first-start, probes, saved-profile).

@rdoupe

rdoupe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@zackees this fixes the AppImage crash (#426). A human tester confirmed it just now, live on YouTube: the CI-built AppImage from this PR started with their real profile and Screen Capture sources, no crash, and the capture streams. All checks are green and it merges cleanly. If it can land before the 09:00 UTC daily release, the next beta ships the fix.

@zackees
zackees merged commit 54435f0 into obs-rust:master Oct 13, 2026
28 checks passed
@zackees

zackees commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

@zackees this fixes the AppImage crash (#426). A human tester confirmed it just now, live on YouTube: the CI-built AppImage from this PR started with their real profile and Screen Capture sources, no crash, and the capture streams. All checks are green and it merges cleanly. If it can land before the 09:00 UTC daily release, the next beta ships the fix.

Outstanding fix and verification.

Release process started. 🫡

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: releases crash on launch when a scene has a PipeWire screen capture

2 participants