Fix Linux .deb runtime crashes and source build on Ubuntu 22.04/24.04/26.04#6
Merged
Conversation
…26.04 The prebuilt Linux .deb crashed on launch on clean Ubuntu 24.04/26.04 (libOpenGL.so.0 and transitive libs not found, then ImGui "Failed to initialize OpenGL loader!"), and building from source failed. One Linux build now serves all three LTS releases. Runtime (.deb packaging in release.yml): - Depend on libopengl0: the binary links GLVND's libOpenGL.so.0, but the package only depended on libgl1 -> instant load-time crash on a clean box. - Bundle the dependency *closure* of the RealSense+OpenCV libraries (this catches libprotobuf.so.23 and libtbb.so.2 that the old name allow-list missed) and patchelf $ORIGIN onto every bundled .so. RUNPATH does not propagate to a library's own deps, and those sonames are gone on 24/26. - Ship librealsense udev rules (non-root camera access) and a 256px icon; reload udev + icon/desktop caches in postinst. Depends widened to the host GL/GTK/X11/runtime/USB stack (names resolve on 24/26 via t64 Provides). ImGui GL loader (imgui_impl_opengl3_loader.h): - dlopen libGL.so.1 (the runtime soname) before the dev-only libGL.so symlink, which is absent on end-user machines. This crashed every clean Linux box, not just 26.04. Linux/GLX branch only; macOS/Windows untouched. Build (build.yml / release.yml / README.md / CMakeLists.txt): - Add libx11-dev/libxext-dev: find_package(X11) aborted configure on 26.04. - librealsense apt repo falls back to noble when the running codename is not served (Intel returns 403 for resolute/oracular/plucky). - -march=native is now opt-in via IRTRACK_NATIVE_ARCH (default OFF); the distributed binary targets a portable x86-64 baseline. - Document the Ubuntu 22.04/24.04/26.04 build recipe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bded9f7 to
0a556c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The prebuilt Linux
.debran fine on Ubuntu 22.04 (the CI build target) but crashed on launch on a clean Ubuntu 24.04/26.04, and building from source failed. Root-caused on a clean Ubuntu 26.04 box; one Linux build now serves 22.04/24.04/26.04 (no separate 26.04 build needed).Runtime crashes (
.deb) — three latent bugs that 22.04 maskedlibOpenGL.so.0missing — the binary links GLVND'slibOpenGL.so.0, but the package onlyDepends-ed onlibgl1→error while loading shared libraries: libOpenGL.so.0. Now depends onlibopengl0.patchelfran only on the binary, but RUNPATH$ORIGINdoes not propagate to a library's own dependencies, and the name allow-list missedlibprotobuf. Solibopencv_core→libtbb.so.2andlibopencv_dnn→libprotobuf.so.23weren't found, and those sonames don't exist on 24/26 (libtbb.so.2→.so.12). Now bundles the dependency closure of the RealSense+OpenCV libs and sets$ORIGINon every bundled.so.dlopen("libGL.so")— the dev-only symlink, absent on runtime-only machines →Failed to initialize OpenGL loader!→ abort. Now trieslibGL.so.1first (Linux/GLX branch only; macOS/Windows untouched). This affected every clean Linux box, not just 26.04.Also: ship the RealSense udev rules (non-root camera access — otherwise "No RealSense devices found") and the app icon;
Dependswidened to the host GL/GTK/X11/runtime/USB stack (names resolve on 24/26 via thet64Provides).Source build
libx11-dev/libxext-dev—find_package(X11)aborted configure on 26.04.noblewhen the running codename isn't served (Intel returns 403 forresolute/oracular/plucky).-march=nativeis now opt-in via-DIRTRACK_NATIVE_ARCH=ON; the distributed binary targets a portable x86-64 baseline (avoids SIGILL on CPUs older than the CI runner).Verification (on a clean Ubuntu 26.04)
libOpenGL.so.0crash)..debwithdpkg-deb(Depends, postinst/postrm, icon, udev rules all correct).-fsyntax-only; CMake configures through RealSense + OpenCV; both workflows passbash -nand YAML validation.nullglob, retry + 403/404-only codename fallback,libudev1/zlib1gin Depends, icon-cache refresh).🤖 Generated with Claude Code