fix(desktop): preload host libwayland in AppImage to fix EGL abort (#892)#944
Open
esengine wants to merge 1 commit into
Open
fix(desktop): preload host libwayland in AppImage to fix EGL abort (#892)#944esengine wants to merge 1 commit into
esengine wants to merge 1 commit into
Conversation
) The bundled libwayland-client.so.0 inside the AppImage was built on Ubuntu 22.04 CI and ABI-mismatches the host Wayland compositor on distros that ship a different libwayland (openSUSE Tumbleweed, Fedora, Arch on some weeks). The mismatch makes WebKitWebProcess::eglGetDisplay() return EGL_BAD_PARAMETER and the process aborts with a short stack before the first paint — exactly the SIGABRT the AppImage user in #892 still hits even with #895's DMABUF disable in place. WebKitWebProcess is fork+exec'd from the parent and inherits the env, so setting LD_PRELOAD to the host's libwayland in main() redirects just the child's dynamic linker without disturbing the already-loaded parent. Gate it on APPDIR + WAYLAND_DISPLAY so distro packages, debug builds, and X11 sessions are untouched. Skip the bare /usr/lib/libwayland-client.so.0 path — on 64-bit Fedora it can be a 32-bit library and the loader rejects it with an ELF-class warning. Pattern confirmed by Tolaria, yaak, nym-vpn-client and the wider Tauri AppImage user base (tauri-apps/tauri#11988, gitbutlerapp/gitbutler#5282).
Closed
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.
Summary
#895shippedWEBKIT_DISABLE_DMABUF_RENDERER=1for APPIMAGE启动后黑屏 #892, but the reporter still hits the sameWebKitWebProcessSIGABRT on openSUSE Tumbleweed + KDE Plasma 6 Wayland + Intel UHD. Reproduced in a Tumbleweed VM — the actual abort message isCould not create default EGL display: EGL_BAD_PARAMETER. Aborting..., which fires before DMABUF init, so fix(desktop): disable WebKit DMABUF renderer on Linux (AppImage black screen) #895 was treating a symptom that isn't on the failing path.libwayland-client.so.0from the Ubuntu CI runner; distros with a divergent libwayland ABI (Tumbleweed / Fedora / Arch on some weeks) makeeglGetDisplay()returnEGL_BAD_PARAMETERand WebKitGTK 2.42+ aborts unconditionally. Same pattern Tauri ecosystem has hit repeatedly — see tauri-apps/tauri#11988, gitbutlerapp/gitbutler#5282, Tolaria's auto-handling, yaak.app's writeup.main()entry, when we detect AppImage (APPDIR) + Wayland (WAYLAND_DISPLAY) on Linux, setLD_PRELOADto the first existing host libwayland (/usr/lib64/..., then Debian-multiarch path).WebKitWebProcessis fork+exec'd from us, inherits the env, and links against the host libwayland instead of the bundled one. Also forceWEBKIT_DISABLE_COMPOSITING_MODE=1on the same code path. The DMABUF disable from fix(desktop): disable WebKit DMABUF renderer on Linux (AppImage black screen) #895 becomes a small helper but stays always-on for Linux (covers Mesa stacks that DON'T need the libwayland swap).Test plan
cargo check --target x86_64-pc-windows-msvc— confirms the rest ofmain.rsstill compilestarget_os = "linux"body on Linux runnersworkflow_dispatchand hand to the APPIMAGE启动后黑屏 #892 reporter for a real-hardware confirmation before declaring fixed. The fix is environment-specific enough that VM testing alone isn't sufficient — the Tumbleweed VM hits the same EGL abort because the VBox vmwgfx driver is independently broken, which masked the libwayland-mismatch theory until we actually read the error message.Refs #892. Will close once huangsijun17 confirms on real hardware.