fix(appimage): resolve libcef.so for lib4bin so Linux bundle stops aborting#1602
Conversation
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.
📝 WalkthroughWalkthroughThe Tauri desktop build workflow adds a Linux-only workaround for AppImage bundling. Before the standard bundled build runs, a pre-build step with ChangesLinux AppImage CEF Build Workaround
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/build-desktop.yml
| 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}" |
There was a problem hiding this comment.
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.
| 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).
Summary
Linux staging build keeps aborting at the AppImage bundler with quick-sharun's generic banner:
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:
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:
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