Skip to content

fix(appimage): reject bundles missing the CEF runtime#4805

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
NgoQuocViet2001:fix/appimage-runtime-libraries
Jul 14, 2026
Merged

fix(appimage): reject bundles missing the CEF runtime#4805
senamakel merged 2 commits into
tinyhumansai:mainfrom
NgoQuocViet2001:fix/appimage-runtime-libraries

Conversation

@NgoQuocViet2001

@NgoQuocViet2001 NgoQuocViet2001 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extend the final AppImage runtime guard to require both libxdo.so* and libcef.so*.
  • Fail release packaging with an actionable error when the CEF runtime did not survive bundling.
  • Add Linux regression coverage for missing libxdo, missing libcef, and a complete bundle.

Problem

  • error while loading shared libraries: libxdo.so.3 on AppImage #4020 reports AppImages failing at launch because required runtime libraries are absent.
  • The existing post-package guard covers libxdo.so* only. A current Fedora report shows the same release artifact missing libcef.so, while the earlier CEF prewarm/staging steps do not prove that the final AppDir still contains it.

Solution

  • Validate both required library patterns across the existing shared/lib, usr/lib, and lib roots after packaging.
  • Keep the guard scoped to sharun-based AppDirs, preserving the existing non-sharun behavior.
  • Preserve the existing libxdo diagnostic and add a CEF-specific diagnostic that points maintainers to the cache/prewarm path.
  • Exercise every outcome in the existing release-script regression test.

Submission Checklist

> If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — all added shell validation branches are executed by the focused regression test; the CI diff gate remains authoritative.
  • Coverage matrix updated — N/A: release-packaging guard only; no feature row was added, removed, or renamed.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related — N/A: no coverage-matrix feature ID applies.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces (docs/RELEASE-MANUAL-SMOKE.md) — N/A: this automates a pre-release artifact invariant and adds no new manual flow.
  • Linked issue closed via Closes #NNN in the ## Related section

Impact

  • Linux AppImage release path only; desktop, mobile, web, CLI, and non-sharun bundle behavior are unchanged.
  • Valid artifacts have no runtime or performance change.
  • An incomplete AppImage now fails before signing/upload instead of reaching users and failing at launch.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

> Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: fix/appimage-runtime-libraries
  • Commit SHA: c6a2d418fbe5c5b5ed29be5f9be64c1550ead186

Validation Run

  • pnpm --filter openhuman-app format:check — Prettier passed; the chained Rust format check is blocked by missing cargo and documented below.
  • pnpm typecheck — N/A: shell-only release validation change.
  • Focused tests: wsl.exe -d Ubuntu-24.04 -- bash -lc "bash scripts/release/test-strip-appimage-rpaths.sh"
  • Rust fmt/check (if changed): N/A — no Rust files changed.
  • Tauri fmt/check (if changed): N/A — no Tauri files changed.
  • Shell validation: bash -n, shellcheck --severity=warning, and git diff --check.

Validation Blocked

  • command: pnpm --filter openhuman-app format:check (also invoked by the pre-push hook)
  • error: Prettier reported all matched files clean, then the chained Rust formatting step failed because cargo is not installed on the Windows host.
  • impact: Rust formatting and the remaining full pre-push checks could not run locally. No Rust/TypeScript/app files changed; the Linux shell regression, syntax check, ShellCheck, and whitespace check pass.

Behavior Changes

  • Intended behavior change: reject a sharun AppImage whose final bundle lacks either libxdo or the CEF runtime.
  • User-visible effect: maintainers get an actionable release failure; users no longer receive that incomplete artifact after this guard passes CI.

Parity Contract

  • Legacy behavior preserved: the existing libxdo guard, library search roots, and non-sharun early return remain intact.
  • Guard/fallback/dispatch parity checks: focused test covers missing libxdo, missing libcef, and both libraries present.

Duplicate / Superseded PR Handling

Summary by CodeRabbit

  • Bug Fixes

    • AppImage release validation now detects missing required graphics and runtime libraries, including CEF and enigo dependencies.
    • Builds fail with specific error messages when any required library is absent.
  • Tests

    • Expanded release validation coverage for missing and present library combinations.

Summary by CodeRabbit

  • Bug Fixes

    • AppImage release validation is now stricter for bundles using the sharun launcher, requiring both the enigo dependency (libxdo.so.*) and the CEF runtime (libcef.so*).
    • Validation failures are reported with library-specific errors, improving clarity when required components are missing.
  • Tests

    • Expanded release validation coverage to verify failure when only libxdo.so.* is present, and success when both libxdo.so.* and libcef.so* are included.

@NgoQuocViet2001
NgoQuocViet2001 requested a review from a team July 13, 2026 04:56
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Sharun-based AppImage validation now requires both libxdo.so* and libcef.so*. Validation failures clean up temporary workspaces, and regression tests cover missing and complete runtime-library cases.

Changes

AppImage runtime guards

Layer / File(s) Summary
Required library validation and cleanup
scripts/release/strip-appimage-graphics-libs.sh
The guard checks both required libraries across supported roots, reports missing patterns, and returns after cleaning the temporary workspace when validation fails.
Runtime guard regression tests
scripts/release/test-strip-appimage-rpaths.sh
Tests verify failure when libcef.so is absent and success when both required libraries are present.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: m3ga-mind

Poem

A bunny checks the libs with care,
libxdo and libcef both hide there.
Missing one? The build says “no!”
Both arrive, and green lights glow.
Hop, ship, and launch with flair!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR guards sharun AppImages against missing runtime libraries, which should prevent the libxdo launch failure reported in #4020.
Out of Scope Changes check ✅ Passed The added libcef check and cleanup behavior are still tied to the AppImage release guard and do not appear unrelated.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the AppImage validation change, though it highlights only the CEF runtime and omits the new libxdo requirement.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/release/test-strip-appimage-rpaths.sh (1)

139-152: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test cases correctly cover the expanded guard.

Test 2b properly verifies that libxdo alone is insufficient (libcef missing → fail), and 2c verifies the happy path with both libraries present. The subshell ( ... ) correctly contains the exit 1 from the function, and 2>/dev/null suppresses expected error output during negative tests.

One note: test 2c implicitly depends on libxdo.so.3 created in 2b. If 2b is ever removed or reordered, 2c would fail with a confusing message. Consider creating both files explicitly in 2c for self-containment.

♻️ Optional: make test 2c self-contained
 # 2c — both required runtime libraries present → must pass.
 mkdir -p "$GUARD_DIR/usr/lib"
+: > "$GUARD_DIR/shared/lib/libxdo.so.3"
 : > "$GUARD_DIR/usr/lib/libcef.so"
 if ! ( validate_appimage_required_libs "$GUARD_DIR" ) 2>/dev/null; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/release/test-strip-appimage-rpaths.sh` around lines 139 - 152, Make
test case 2c self-contained by explicitly creating both libxdo.so.3 and
libcef.so before calling validate_appimage_required_libs, rather than relying on
the fixture created in test 2b. Keep the existing success assertion and failure
message unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/release/strip-appimage-graphics-libs.sh`:
- Line 519: Update strip_one_appimage to install an EXIT cleanup trap
immediately after creating workdir, ensuring validate_appimage_required_libs
failures and all other exits remove the temporary directory. Preserve the
existing success and failure behavior while avoiding duplicate cleanup or unsafe
removal when workdir is unset.

---

Nitpick comments:
In `@scripts/release/test-strip-appimage-rpaths.sh`:
- Around line 139-152: Make test case 2c self-contained by explicitly creating
both libxdo.so.3 and libcef.so before calling validate_appimage_required_libs,
rather than relying on the fixture created in test 2b. Keep the existing success
assertion and failure message unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4bf85d57-7f1a-4d80-bde0-8932f4e8ffd6

📥 Commits

Reviewing files that changed from the base of the PR and between c58fe10 and d91e219.

📒 Files selected for processing (2)
  • scripts/release/strip-appimage-graphics-libs.sh
  • scripts/release/test-strip-appimage-rpaths.sh

Comment thread scripts/release/strip-appimage-graphics-libs.sh Outdated
@senamakel
senamakel merged commit 7711557 into tinyhumansai:main Jul 14, 2026
20 of 24 checks passed
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.

error while loading shared libraries: libxdo.so.3 on AppImage

2 participants