Skip to content

Desktop: fix Linux AppImage compatibility on newer distributions - #7953

Merged
danielhanchen merged 8 commits into
unslothai:mainfrom
oobabooga:fix/thin-linux-appimage
Aug 6, 2026
Merged

danielhanchen merged 8 commits into
unslothai:mainfrom
oobabooga:fix/thin-linux-appimage

Conversation

@oobabooga

@oobabooga oobabooga commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

The 0.1.52-beta Linux AppImage cannot download models on Linux Mint 22 Wilma, based on Ubuntu 24.04 Noble. This is a release-blocking functional failure, not a visual issue.

Selecting a model and variant from the picker at the top of the app does nothing. There is no toast, progress, or error, and the backend receives no POST /api/hub/download request. Restarting does not recover it. The failure was reported on two computers and reproduced locally with the released AppImage. The deb works on the same Linux Mint 22 machine.

Root cause

The AppImage bundled the Ubuntu 22.04 GLib, GTK, WebKitGTK, curl, and nghttp2 stack while loading newer GIO, GVFS, dconf, and network libraries from the host. The broken process reports:

libcurl-gnutls.so.4: undefined symbol: nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation

This ABI mismatch breaks the desktop webview before the download request reaches the healthy local backend.

Build a thin AppImage from the working deb payload so it uses one coherent host GTK/WebKit runtime.

This follows AppImage's official compatibility guidance: build on an older supported base and exclude system libraries that can break target systems when bundled. Ubuntu 22.04 remains the baseline, with missing host dependencies reported at startup.

What changed

  • Build the Linux deb once and package its payload without deploying desktop or network libraries.
  • Preserve host library search paths in AppRun and spawned backend commands.
  • Detect missing host GTK/WebKit libraries at startup and show installation instructions instead of failing silently.
  • Pin and verify appimagetool and the AppImage runtime, then sign and stage the custom artifact through the existing updater flow.
  • Reject the artifact if GLib, GTK, WebKitGTK, curl, or nghttp2 libraries are bundled.

The compatibility floor is Ubuntu 22.04, Linux Mint 21, and Debian 12. Newer releases with GTK 3 and WebKitGTK 4.1 are expected to work. The deb and non-Linux packages are unchanged.

Testing

  • python3 -m pytest -q tests/security tests/studio/test_tauri_branding_contract.py (198 passed)
  • Reproduced the silent download failure with the released AppImage on Linux Mint 22 and confirmed the deb works.
  • Launched the fixed AppImage, selected Qwen3.5-9B-GGUF Q4_0, observed the download request return 202 and report progress, then canceled it successfully with another 202 response.
  • Extracted the final 45.6 MB artifact and confirmed the guarded libraries are absent.
  • Workflow validation, shell syntax, and git diff --check passed.

@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: d50d41bf1a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member 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: 65984b12b7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/release-desktop.yml Resolved
@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@oobabooga oobabooga changed the title Desktop: fix model downloads in the Linux AppImage Desktop: fix Linux AppImage compatibility on newer distributions Aug 5, 2026

@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: 350019a6c8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/release-desktop.yml Resolved
Comment thread .github/workflows/release-desktop.yml Resolved
@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 39c1af5e9c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Resolve the release-desktop.yml conflict on the Linux build step.

main (unslothai#8005) only labelled the tauri-action pin with `# v0.6.2`. This
branch drops the step's `env` block, since the deb build no longer needs
the Tauri signing key or the tauri-tools cache path: signing moved to the
"Build and sign thin Linux AppImage" step, which sets both signing
secrets itself. Keep the deletion and take the version label.

@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: 10fe73d4a3

ℹ️ 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".

Comment on lines +128 to +131
missing=$(
ldd "$binary" 2>/dev/null |
sed -n 's/^[[:space:]]*\([^[:space:]]*\)[[:space:]]*=>[[:space:]]*not found.*$/\1/p'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Probe the dynamically loaded tray library

When GTK and WebKit are installed but neither libayatana-appindicator3.so.1 nor libappindicator3.so.1 is present, this ldd-only check reports no missing dependency because libappindicator-sys loads the tray library through libloading (Cargo.lock:2357-2365). The binary then proceeds to the mandatory setup_tray call (src/main.rs:550-552) and can exit during initialization instead of displaying the installation guidance. The clean-machine AppImage job masks this case by explicitly installing libayatana-appindicator3-1 in .github/workflows/desktop-app-clean-machine-ci.yml:344-345; probe that dynamic dependency explicitly before executing the binary.

Useful? React with 👍 / 👎.

Comment on lines 603 to 605
// Tauri uses the legacy root regardless of UNSLOTH_STUDIO_HOME / STUDIO_HOME;
// scrub so the spawned Python backend can't diverge. UNSLOTH_LLAMA_CPP_PATH
// is a pre-existing user-controlled llama.cpp dir override; keep it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Continue scrubbing Python-specific environment variables

When the AppImage is launched from a shell or desktop session with PYTHONHOME or PYTHONPATH set, the managed backend now inherits those variables and may use the wrong standard library or shadow packages, causing the backend to fail before startup. Thin packaging removes the reason to clear the AppImage's old LD_LIBRARY_PATH, but it does not make these Python-specific variables safe; the Windows command path still removes both for the same isolation reason (update.rs:55-57). Preserve the host library path while continuing to remove PYTHONHOME and PYTHONPATH from the managed Linux subprocesses.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants