Repository navigation
build-aux: Bundle PipeWire in the AppImage and test it with a saved profile - #437
Conversation
|
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. |
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]>
ce2ed54 to
1956d9f
Compare
|
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. |
|
Demonstrated RED→GREEN in CI. I pushed the RED commit bf7fac3 alone to a temporary branch and dispatched appimage.yaml (run 38343881775):
|
|
@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. 🫡 |
Description
Every published AppImage (
continuousand the dated beta) crashed on start for anyone whose scene holds a Screen Capture (PipeWire) source:AppRunpoints 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.ci: Test the AppImage with a saved PipeWire profile (RED):test-appimage.shtakes one scenario, and CI runs each in its own fresh stock container (Debian 13, Ubuntu 22.04, Fedora):bundle: every pathAppRunexports 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 inAppRun'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, andverify-recording.shchecks 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.AppRunsaved a crash report.AppRunrestarts a crashed OBS under gdb, which hid crashes from the old test.release-rust.yaml) only takes the AppImage artifact when the AppImage workflow passed.continuousalready waits for every test job.build-aux: Bundle PipeWire's modules and client.conf in the AppImage (GREEN): the build host installslibpipewire-0.3-modulesandpipewire-bin, andassemble-appdir.shfails if any directoryAppRunexports is missing instead of skipping it.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):
continuousf44de6ee67ddbbb5b5(#429, old packaging)g6df26d562)streaming.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.Types of changes
Checklist:
🤖 Generated with Claude Code