Skip to content

Bug: AppImage injects bundled libs into system git's environment, breaking on modern distros #644

@jmoseley

Description

@jmoseley

On Arch Linux (and likely other rolling-release distros), all git operations fail with:

git: /tmp/appimage_extracted_.../usr/lib/libpcre2-8.so.0: no version information available (required by git)
git-remote-https: /tmp/appimage_extracted_.../usr/lib/libssl.so.3: version `OPENSSL_3.2.0' not found (required by /usr/lib/libcurl.so.4)
git-remote-https: /tmp/appimage_extracted_.../usr/lib/libssl.so.3: version `OPENSSL_3.5.0' not found (required by /usr/lib/libngtcp2_crypto_ossl.so.0)
fatal: remote helper 'https' aborted session

This practically means all sessions fail upon creation. I documented in this comment in detail.

Root cause: When the AppImage spawns git subprocesses, it passes its extracted lib directory (e.g. /tmp/appimage_extracted_.../usr/lib) via LD_LIBRARY_PATH. This causes the system git binary to load the AppImage's outdated bundled libssl and libpcre2 instead of system ones, which on my Arch installation are incompatible.

Workaround: Wrapping /usr/bin/git to strip AppImage paths from LD_LIBRARY_PATH before execution resolves the issue:

sudo mv /usr/bin/git /usr/bin/git.real
sudo tee /usr/bin/git << 'EOF'
#!/bin/bash
export LD_LIBRARY_PATH=$(echo "$LD_LIBRARY_PATH" | tr ':' '\n' | grep -v '/tmp/appimage' | tr '\n' ':' | sed 's/:$//')
exec /usr/bin/git.real "$@"
EOF
sudo chmod +x /usr/bin/git

I also needed to add additional flags:

APPIMAGE_EXTRACT_AND_RUN=1  LD_PRELOAD=/usr/lib64/libwayland-client.so.0:/usr/lib64/libwayland-egl.so.1:/usr/lib64/libwayland-server.so.0:/usr/lib64/libwayland-cursor.so.0 ./GitHub-Copilot-linux-x64.appimage

This workaround should not be required for general users. Suggested fixes:

  • Sanitize LD_LIBRARY_PATH before spawning git subprocesses
  • Bundle a fully self-contained git inside the AppImage
  • Launch git in a clean environment via env -i

Environment:

  • OS: Arch Linux
  • Kernel: 7.0.10-zen1-1-zen
  • OpenSSL 3.6.2
  • App: GitHub Copilot AppImage (linux-x64)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions