Use selective LD_PRELOAD to keep bundled libraries in sync with the host distro - #754
Merged
mehmetozguldev merged 2 commits intoSep 17, 2026
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The launcher may override bundled CEF graphics libraries and omits /lib-family paths needed on non-usr-merged systems.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates the Linux tarball launcher to prefer host libraries and prevent startup crashes on modern distributions.
Changes:
- Adds host-library discovery and
LD_LIBRARY_PATHconfiguration. - Adds packaging tests for the generated launcher.
File summaries
| File | Summary |
|---|---|
scripts/release/tests/linux-packaging.test.ts |
Verifies host-library resolution in the launcher. |
scripts/release/packaging/linux/tarball.sh |
Configures host library precedence; requires narrowing the override and covering /lib variants. |
Review details
Suppressed comments (1)
scripts/release/packaging/linux/tarball.sh:84
- The launcher omits the
/libfamily (/lib,/lib64, and multiarch/lib/*-linux-gnu). On non-usr-merged glibc hosts those are the actual system-library directories; because they are not added toLD_LIBRARY_PATH, the bundled$ORIGINcopies still win over the hostlibxkbcommon, Fontconfig, and NSS libraries, so the reported crash remains. Add or derive both/liband/usr/libvariants.
case "$(uname -m)" in
x86_64 | amd64)
system_lib_dirs=(
/usr/lib/x86_64-linux-gnu
/usr/lib64
/usr/lib
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| done | ||
|
|
||
| if [[ -n "$system_ld_path" ]]; then | ||
| export LD_LIBRARY_PATH="${system_ld_path}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" |
theajmalrazaq
force-pushed
the
fix-linux-tarball-library-precedence
branch
from
September 15, 2026 21:13
0f12f33 to
7af0dd6
Compare
Contributor
|
Indeed solves the issue. Works on my CachyOS machine aswell. |
Contributor
|
thanks for the amazing fix and report! |
mehmetozguldev
self-requested a review
September 17, 2026 13:42
…ost distro The Linux tarball bundles every non-glibc runtime dependency from the CI runner (Ubuntu). On newer distros the bundled versions of system-integration libraries (xkbcommon, fontconfig, NSS, …) are too old, causing crashes on startup (dead_hamza keysym parse failure, missing NSSUTIL_3.108 symbols, incompatible fontconfig schemas). Fix this by LD_PRELOADing the host copy of every bundled library that exists on the running system, except for CEF's own graphics runtime (libEGL.so, libGLESv2.so, libvulkan.so.1, libvk_swiftshader.so, libcef.so) which must remain bundled to avoid ABI/rendering failures. This is an exclusion-based approach — a small protected_libs list names the CEF-owned files that must stay bundled, while everything else in libexec/ is automatically overridden when a host copy is found. No manually maintained whitelist is needed: new libraries added to the bundle will get the host-override treatment automatically. Multi-architecture support: the launcher probes distro-specific library directories (Debian multiarch, Fedora/RHEL lib64, Arch flat /usr/lib) at runtime so it works across all major Linux distributions. Fixes athasdev#753
theajmalrazaq
force-pushed
the
fix-linux-tarball-library-precedence
branch
from
September 17, 2026 14:08
7af0dd6 to
b8e4a84
Compare
Keep compiler and CEF runtimes bundled instead of replacing every shared library with the host copy. Select XKB and NSS dependency groups together and retain the bundle when a required host library is missing. Exercise launcher selection, fallback, library paths, and argument forwarding with executable shell regression tests.
mehmetozguldev
approved these changes
Sep 17, 2026
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.
The Linux tarball can fail on newer distributions when its bundled XKB, Fontconfig, or NSS libraries conflict with host data and runtime modules.
Prefer host copies only for XKB, Fontconfig, and NSS/NSPR libraries already present in the bundle. Keep compiler runtimes such as libstdc++ and the CEF graphics runtime bundled. Switch each bundled XKB or NSS/NSPR dependency group together; if any required host copy is unavailable, retain the bundled group. Preserve existing LD_PRELOAD entries and launcher arguments.
Validation: all 55 release tests pass through Vite+, including 16 executable launcher cases covering selection, grouped fallback, x86_64/aarch64 library directories, and argument forwarding. The runtime-library retention test fails against the previous PR implementation. TypeScript, focused lint/format checks, and Bash syntax checks pass.
The tests exercise launcher selection with fixture libraries; they do not prove ELF loading or CEF startup. The revised launcher still needs real application startup checks on Arch Linux and an older supported Ubuntu release. Release dry-run/preflight was attempted in the isolated PR checkout and stopped on release-only main/clean-tree requirements.
Fixes #753