Skip to content

fix(appimage): resolve libcef.so for lib4bin so Linux bundle stops aborting#1602

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
senamakel:fix/appimage-libcef-rpath
May 13, 2026
Merged

fix(appimage): resolve libcef.so for lib4bin so Linux bundle stops aborting#1602
senamakel merged 1 commit into
tinyhumansai:mainfrom
senamakel:fix/appimage-libcef-rpath

Conversation

@senamakel
Copy link
Copy Markdown
Member

@senamakel senamakel commented May 13, 2026

Summary

Linux staging build keeps aborting at the AppImage bundler with quick-sharun's generic banner:

OpenHuman is missing libraries! Aborting...

The post-build ldd diagnostic added in #1591 ran on the latest failing job (https://github.com/tinyhumansai/openhuman/actions/runs/25785303625/job/75737262316) and narrowed the culprit to a single unresolved symbol:

libcef.so => not found

Why this happens

The vendored tauri-cef bundler (`app/src-tauri/vendor/tauri-cef/.../sharun_cef.rs`) copies `libcef.so` into the staged AppDir at `usr/lib/libcef.so` and downloads the CEF distribution into `~/.cache/tauri-cef///` at build time. But the OpenHuman binary's `DT_RUNPATH` does not point at either location, so when `lib4bin` runs `ldd` against the staged binary to discover transitive libraries, `libcef.so` is unresolved on the loader's default search path. lib4bin then aborts before it has a chance to copy CEF into the sharun bundle — which is why the banner says "missing libraries" even though `libcef.so` is physically present in the AppDir.

Fix

Linux-only change to the `Build and package Tauri app` step:

  1. Run `cargo tauri build --no-bundle` first so the cef-dll-sys build script populates `~/.cache/tauri-cef/`.
  2. `find` the CEF lib dir and prepend it to `LD_LIBRARY_PATH`.
  3. Re-invoke `cargo tauri build` (incremental — cargo's target dir is warm, no recompile) so the bundler's `ldd` resolves `libcef.so`.

macOS and Windows matrix entries keep the original single-call path.

Failing job for reference: https://github.com/tinyhumansai/openhuman/actions/runs/25785303625/job/75737262316

Test plan

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced Linux AppImage build process to ensure proper dependency resolution during compilation.

Review Change Stack

The Linux staging build keeps failing at the AppImage bundler with
quick-sharun's generic banner:

    OpenHuman is missing libraries! Aborting...

The post-build ldd diagnostic added in tinyhumansai#1591 narrowed it to a single
unresolved symbol:

    libcef.so => not found

Root cause: the vendored tauri-cef bundler (sharun_cef.rs) copies
libcef.so into the staged AppDir at usr/lib/libcef.so and downloads the
CEF distribution into ~/.cache/tauri-cef/<version>/<os-arch>/, but the
OpenHuman binary's DT_RUNPATH does not point at either location. When
lib4bin runs `ldd` against the staged binary to discover transitive
libraries, libcef.so is unresolved on the loader's default search path
and lib4bin aborts before it can copy CEF into the sharun bundle.

Fix on Linux only: split `cargo tauri build` into two phases —
`--no-bundle` first so the cef-dll-sys build script populates the CEF
cache dir, then a second invocation with that dir prepended to
LD_LIBRARY_PATH so the bundler's ldd resolves libcef.so. The second
build is incremental (no recompile) since cargo's target dir is already
warm; only the bundling step does real work. macOS and Windows matrix
entries keep the original single-call path.
@senamakel senamakel requested a review from a team May 13, 2026 08:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

The Tauri desktop build workflow adds a Linux-only workaround for AppImage bundling. Before the standard bundled build runs, a pre-build step with --no-bundle forces the vendored CEF library to download into cache. The cached library directory is then located and prepended to LD_LIBRARY_PATH for the bundled build, with explicit failure if CEF is not found.

Changes

Linux AppImage CEF Build Workaround

Layer / File(s) Summary
Two-phase Tauri build with CEF cache preparation
.github/workflows/build-desktop.yml
A Linux-only conditional shell script is added to the build step that runs cargo tauri build --no-bundle to download CEF into cache, discovers the cached libcef.so directory, updates LD_LIBRARY_PATH to include it, and runs the full bundling build with explicit failure when CEF is not found.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • tinyhumansai/openhuman#1591: The AppImage bundling workaround in this PR's workflow changes are directly related to diagnosing and fixing missing Linux AppImage shared libraries.
  • tinyhumansai/openhuman#1087: Both PRs modify Linux packaging and bundling behavior in the Tauri workflow to adjust how the built app is packaged or launched on Linux.

Poem

🐰 A CEF that hides in cache so deep,
Now found by bundles, secrets to keep—
Two builds as one, the path shines bright,
Linux AppImages bundled just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing a Linux AppImage bundling issue by resolving libcef.so dependencies, matching the changeset's primary purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/build-desktop.yml:
- Around line 429-435: The current CEF_LIB_DIR assignment uses "find ... | head
-1" which can select an arbitrary libcef.so when multiple caches exist; change
the find invocation that sets CEF_LIB_DIR to deterministically pick the newest
candidate (e.g., list all matching libcef.so files, sort by modification time or
timestamp, select the most recent, and extract its parent directory) so the
script always prepends the latest CEF cache to LD_LIBRARY_PATH; keep the
existing error check, log message, and export of LD_LIBRARY_PATH using the
CEF_LIB_DIR variable (preserve the CEF_LIB_DIR name and the subsequent
echo/export lines).
🪄 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: d337d155-29a7-482e-be0f-f5f3907b9a05

📥 Commits

Reviewing files that changed from the base of the PR and between de33b12 and c374ef7.

📒 Files selected for processing (1)
  • .github/workflows/build-desktop.yml

Comment on lines +429 to +435
CEF_LIB_DIR="$(find "$HOME/.cache/tauri-cef" -name libcef.so -printf '%h\n' 2>/dev/null | head -1)"
if [ -z "$CEF_LIB_DIR" ]; then
echo "::error::libcef.so not found under ~/.cache/tauri-cef after --no-bundle compile; cannot satisfy lib4bin ldd resolution." >&2
exit 1
fi
echo "[appimage-fix] prepending CEF lib dir to LD_LIBRARY_PATH: $CEF_LIB_DIR"
export LD_LIBRARY_PATH="$CEF_LIB_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make CEF cache selection deterministic on Line 429.

find ... | head -1 can pick an arbitrary cached libcef.so when multiple versions exist, which can make Linux bundling flaky again. Prefer selecting the newest candidate deterministically.

Suggested patch
-            CEF_LIB_DIR="$(find "$HOME/.cache/tauri-cef" -name libcef.so -printf '%h\n' 2>/dev/null | head -1)"
+            CEF_LIB_DIR="$(
+              find "$HOME/.cache/tauri-cef" -type f -name libcef.so -printf '%T@ %h\n' 2>/dev/null \
+                | sort -nr \
+                | awk 'NR==1 { print $2 }'
+            )"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CEF_LIB_DIR="$(find "$HOME/.cache/tauri-cef" -name libcef.so -printf '%h\n' 2>/dev/null | head -1)"
if [ -z "$CEF_LIB_DIR" ]; then
echo "::error::libcef.so not found under ~/.cache/tauri-cef after --no-bundle compile; cannot satisfy lib4bin ldd resolution." >&2
exit 1
fi
echo "[appimage-fix] prepending CEF lib dir to LD_LIBRARY_PATH: $CEF_LIB_DIR"
export LD_LIBRARY_PATH="$CEF_LIB_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
CEF_LIB_DIR="$(
find "$HOME/.cache/tauri-cef" -type f -name libcef.so -printf '%T@ %h\n' 2>/dev/null \
| sort -nr \
| awk 'NR==1 { print $2 }'
)"
if [ -z "$CEF_LIB_DIR" ]; then
echo "::error::libcef.so not found under ~/.cache/tauri-cef after --no-bundle compile; cannot satisfy lib4bin ldd resolution." >&2
exit 1
fi
echo "[appimage-fix] prepending CEF lib dir to LD_LIBRARY_PATH: $CEF_LIB_DIR"
export LD_LIBRARY_PATH="$CEF_LIB_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
🤖 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 @.github/workflows/build-desktop.yml around lines 429 - 435, The current
CEF_LIB_DIR assignment uses "find ... | head -1" which can select an arbitrary
libcef.so when multiple caches exist; change the find invocation that sets
CEF_LIB_DIR to deterministically pick the newest candidate (e.g., list all
matching libcef.so files, sort by modification time or timestamp, select the
most recent, and extract its parent directory) so the script always prepends the
latest CEF cache to LD_LIBRARY_PATH; keep the existing error check, log message,
and export of LD_LIBRARY_PATH using the CEF_LIB_DIR variable (preserve the
CEF_LIB_DIR name and the subsequent echo/export lines).

@senamakel senamakel merged commit f793a19 into tinyhumansai:main May 13, 2026
15 of 20 checks passed
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
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.

1 participant