Skip to content

Fix AppImage DMA-BUF fallbacks - #8813

Closed
wasimysaid wants to merge 5 commits into
unslothai:mainfrom
wasimysaid:appimage-dmabuf-fallback
Closed

wasimysaid wants to merge 5 commits into
unslothai:mainfrom
wasimysaid:appimage-dmabuf-fallback

Conversation

@wasimysaid

Copy link
Copy Markdown
Collaborator

Summary

  • detect whether an AppImage can actually dlopen("libGLESv2.so.2") before WebKitGTK initializes
  • set WEBKIT_DISABLE_DMABUF_RENDERER=1 when host GLES is unavailable
  • use the full DMA-BUF disable for AppImage Wayland sessions, while keeping the existing WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 behavior for native packages
  • preserve either explicit user renderer override
  • add an Ubuntu 22.04 AppImage portability lane that deliberately has no libGLESv2.so.2

Credit

This ports the two focused runtime fixes identified and tested by @ThomasEricB in #8343. Thomas is included as a co-author on the commit.

Verification

  • cargo test --no-fail-fast — passed
  • frontend production build — passed
  • tests/security/test_release_desktop_appimage.py — 9 passed
  • focused pre-commit hooks and git diff --check — passed
  • built the complete AppImage and ran the packaged startup/auth smoke:
    • Ubuntu 22.04 X11 with libGLESv2.so.2 absent — passed and selected WEBKIT_DISABLE_DMABUF_RENDERER=1
    • Ubuntu 24.04 native Wayland — passed and selected WEBKIT_DISABLE_DMABUF_RENDERER=1
  • extracted Valve's exact SteamOS 3.8.16 image (build 20260716.1) into a version-pinned Distrobox and ran the same AppImage against the inherited real Wayland compositor and exposed DRM devices — rendered startup and desktop authentication passed, with the full DMA-BUF disable logged

The SteamOS check validates the exact userspace and real display/device path, but this host is not a Steam Deck/RADV GPU, so it is not presented as a hardware-exact reproduction of Thomas's Deck result.

Detect unusable host GLES before WebKit starts, disable DMA-BUF for AppImage Wayland sessions, and add a no-GLES portability lane. Preserve native-package behavior and explicit operator overrides.

Adapted from the AppImage compatibility work in unslothai#8343.

Co-authored-by: Thomas Eric <[email protected]>
Replace the global AppDir LD_LIBRARY_PATH launcher with an ORIGIN-only closure, keep host graphics/display/network ABI families host-owned, and verify the boundary after all linuxdeploy plugins. Extend clean-host prerequisites without weakening the no-GLES lane.

Adapted from the mechanism-level AppImage design and measured host-boundary work in unslothai#8343.

Co-authored-by: Thomas Eric <[email protected]>
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 649af18b5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Validate the repository-installed AppRun separately from the four digest-pinned remote tools so desktop release jobs accept the hardened local launcher.

Co-authored-by: Thomas Eric <[email protected]>
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 8d1dcc1140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the gap in studio/src-tauri/src/linux_webkit.rs, where rendering_plan never considers an AppImage host without a usable libGLESv2, and the renderer selection change looks right. The direction is good, but this branch also replaces the AppRun launcher and adds the patchelf RUNPATH finalizer plus the verifier and release-workflow rewrites; could you split those out and keep this one to the renderer selection, then rebase off the conflicts?

@oobabooga

Copy link
Copy Markdown
Member

Closing this one as its code is already in the main branch after #9113.

@oobabooga oobabooga closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants