Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

[codex] relocate bundled bun before Linux AppImage execution (#4752)

Louis Beaumont8e31bb6fcec9
diff --git a/.github/workflows/linux-appimage-smoke.yml b/.github/workflows/linux-appimage-smoke.yml
index 243588f99..c9db37924 100644
--- a/.github/workflows/linux-appimage-smoke.yml
+++ b/.github/workflows/linux-appimage-smoke.yml
@@ -195,6 +195,14 @@ jobs:
squashfs-root/usr/lib/libsharpyuv.so* \
squashfs-root/usr/lib/libavif.so*
+ # linuxdeploy rewrites the bundled bun sidecar with
+ # RUNPATH=$ORIGIN/../lib during AppImage assembly. That makes bun load
+ # the AppImage's bundled libc/libstdc++ set and SIGSEGV on newer hosts
+ # (Debian 13 Sentry/CI repro). Restore the pristine baseline bun that
+ # pre_build.js downloaded so screenpipe can continue scrubbing
+ # LD_LIBRARY_PATH and run bun against the host runtime.
+ install -m 0755 src-tauri/bun-x86_64-unknown-linux-gnu squashfs-root/usr/bin/bun
+
# Guard the libavif/libsharpyuv fix: an orphan bundled libsharpyuv
# shadows the host one and breaks Arch (libavif 1.4.2) with
# "undefined symbol: SharpYuvConvertWithOptions". Fail if either
@@ -355,9 +363,10 @@ jobs:
app_bin="$(find squashfs-root/usr/bin -maxdepth 1 -type f -executable -iname "*screenpipe*" -print -quit)"
test -n "${app_bin}"
- export LD_LIBRARY_PATH=/smoke/squashfs-root/usr/lib
+ app_ld_library_path=/smoke/squashfs-root/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+ unset LD_LIBRARY_PATH
set +e
- su smoke-user -c "cd /smoke && export XDG_RUNTIME_DIR=/tmp/screenpipe-runtime && export SCREENPIPE_E2E_SEED=onboarding,no-recording && export LD_LIBRARY_PATH=/smoke/squashfs-root/usr/lib && timeout 20 dbus-run-session -- xvfb-run -a squashfs-root/AppRun --help" 2>&1 | tee /tmp/apprun-arch.log
+ su smoke-user -c "cd /smoke && export XDG_RUNTIME_DIR=/tmp/screenpipe-runtime && export SCREENPIPE_E2E_SEED=onboarding,no-recording && timeout 20 dbus-run-session -- xvfb-run -a env LD_LIBRARY_PATH=\"${app_ld_library_path}\" squashfs-root/AppRun --help" 2>&1 | tee /tmp/apprun-arch.log
status="${PIPESTATUS[0]}"
set -e
# The exact failure we are guarding against.
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 0912a61bd..6214574e1 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -779,6 +779,7 @@ jobs:
squashfs-root/usr/lib/libpcre2-8.so* \
squashfs-root/usr/lib/libsharpyuv.so* \
squashfs-root/usr/lib/libavif.so*
+ install -m 0755 src-tauri/bun-x86_64-unknown-linux-gnu squashfs-root/usr/bin/bun
echo "Removed bundled GLib libs, repacking AppImage..."
ARCH=x86_64 /tmp/appimagetool squashfs-root "$APPIMAGE"
rm -rf squashfs-root
diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.yml
index 52c12807c..0e4bc0391 100644
--- a/.github/workflows/release-enterprise.yml
+++ b/.github/workflows/release-enterprise.yml
@@ -486,6 +486,7 @@ jobs:
squashfs-root/usr/lib/libpcre2-8.so* \
squashfs-root/usr/lib/libsharpyuv.so* \
squashfs-root/usr/lib/libavif.so*
+ install -m 0755 src-tauri/bun-x86_64-unknown-linux-gnu squashfs-root/usr/bin/bun
echo "Removed bundled GLib libs, repacking AppImage..."
ARCH=x86_64 /tmp/appimagetool squashfs-root "$APPIMAGE"
rm -rf squashfs-root