Skip to content

Desktop: keep the bundled AppImage tray loader off the host's Ayatana - #16613

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
debojyoti-dev:fix/appimage-bundled-tray-ayatana-16605
Nov 5, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
debojyoti-dev:fix/appimage-bundled-tray-ayatana-16605

Conversation

@debojyoti-dev

Copy link
Copy Markdown
Contributor

Requested by Debojyoti

Fixes #16605

Problem

libappindicator-sys 0.9 dlopens libayatana-appindicator3.so.1 first and only then libappindicator3.so.1. The complete AppImage bundles just the legacy libappindicator3.so.1 (via tauri.conf.json), so in bundled mode the first name misses the executable's $ORIGIN/../lib RUNPATH and falls through to the host's Ayatana. That library then binds to the bundled Jammy GLib (2.72), which already occupies the libglib-2.0.so.0 soname, so any GLib 2.80+ symbol it needs is missing. On the reporter's Slackware box (GLib 2.90.1) that aborts with undefined symbol: g_once_init_enter_pointer.

Fix

  • finalize-complete-appimage.sh adds usr/lib/libayatana-appindicator3.so.1 -> libappindicator3.so.1, so the loader's first lookup resolves inside the bundle and bundled mode stays on its own tray and GLib stack. It is idempotent (linuxdeploy runs the finalizer twice) and leaves a real bundled Ayatana untouched.
  • verify-complete-appimage.sh rejects a complete AppImage that bundles libappindicator3.so.1 without a resolvable Ayatana name.
  • Host mode is unchanged: usr/bin/host/unsloth-studio's RUNPATH reaches no bundled library, so it still loads the host's Ayatana against the host's GLib.

Testing

Real runs of the released v0.1.914-beta Unsloth-Desktop-Linux.AppImage, extracted, under Xvfb with UNSLOTH_APPIMAGE_WEBKIT=bundled and LD_DEBUG=libs:

Host Before After this finalizer
Arch (GLib 2.90.1, libayatana-appindicator 0.6.1, the reporter's versions) tries /usr/lib/libayatana-appindicator3.so.1, which hits undefined symbol: g_once_init_leave_pointer against the bundled GLib (it only falls back because this build's dbusmenu binds eagerly) loads usr/lib/libayatana-appindicator3.so.1 from the bundle, never searches the host; app stays up
Ubuntu 26.04 (GLib 2.88) same: host Ayatana tried, libayatana-ido3 fails on g_once_init_leave_pointer bundled alias loaded; app stays up
  • The new verifier check fails on the shipped AppDir and passes after the finalizer; the finalizer was run twice on the real AppDir.
  • tests/security/test_release_desktop_appimage.py and tests/studio/test_appimage_toolchain_contract.py in an Ubuntu 24.04 container: 59 passed, 5 skipped (need full git history), same skips as clean main (57 passed). The two new tests fail on clean main and pass with this change.

libappindicator-sys dlopens libayatana-appindicator3.so.1 before
libappindicator3.so.1, but the complete AppImage only bundles the legacy
libappindicator3.so.1. In bundled mode the first name misses the
executable's RUNPATH and loads the host's Ayatana, which then binds to the
bundled (older) GLib. On hosts whose Ayatana stack references GLib 2.80+
symbols this aborts at startup with an undefined g_once_init_enter_pointer.

The finalizer now aliases libayatana-appindicator3.so.1 to the bundled
library (leaving a real bundled Ayatana alone), and the verifier rejects a
complete AppImage without it. Host mode is unaffected: its copy's RUNPATH
reaches no bundled library.

Fixes unslothai#16605
@danielhanchen danielhanchen self-assigned this Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T12:23:28.254979Z 8d0916b Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 81e8270b36

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

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 8d0916bbb1

ℹ️ 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 added a commit that referenced this pull request Nov 5, 2026
…b cannot break it (#16784)

## Summary

#16768 added `tests/studio/test_playwright_multi_account_open_login.py`,
and all 7 of its tests fail in `Repo tests (CPU, studio)` when an
earlier test in the same worker has stubbed Playwright, for example the
staging run for #16613:

```
test_a_redirect_that_already_loaded_login_is_used
E   RuntimeError: playwright is not installed: Error needs a real browser
E   TypeError: catching classes that do not inherit from BaseException is not allowed
test_a_second_failure_of_the_same_kind_is_real[two aborts]
E   TypeError: Expected a BaseException type, but got 'function'
7 failed, 10029 passed
```

The CPU jobs do not install Playwright.
`tests/studio/test_heavy_thread_measurement_integrity.py` handles that
by putting a stub `playwright.sync_api` into `sys.modules` that answers
every name with a function that raises. My test guarded with
`pytest.importorskip("playwright.sync_api")`, which finds that stub, so
it ran with functions where it expected exception types. Run alone, or
with real Playwright installed, it passed, which is why #16768's own
checks were green.

## Change

`tests/studio/test_playwright_multi_account_open_login.py` only. The
test no longer imports Playwright. It defines `Error` and
`TimeoutError(Error)` itself, matching Playwright's own hierarchy, and
while loading the driver it puts a minimal `playwright.sync_api`
carrying them into `sys.modules` through `monkeypatch`, which restores
the previous modules after each test. The test now runs, rather than
skips, on the CPU jobs, whatever earlier tests left behind. The driver
and the test cases are unchanged.

## Testing

With Playwright made unimportable and
`test_heavy_thread_measurement_integrity.py` run first in the same
process, as on CI:

| | result |
|---|---|
| main | 7 failed, 76 passed (the errors above) |
| this branch | 83 passed |

- With the real Playwright installed: 7 passed.
- Against the driver from before #16768: 3 failed, so the test still
guards the abort and timeout budgets.
@danielhanchen
danielhanchen merged commit 0d9d7a5 into unslothai:main Nov 5, 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.

[Bug] AppImage fails to start on Slackware64-current due to GLib/AppIndicator symbol lookup error

2 participants