Skip to content

fix: bundle gdk-pixbuf SVG loader in AppImage (#80)#81

Open
manuacl wants to merge 1 commit into
am-will:mainfrom
manuacl:fix/issue-80-bundle-svg-loader
Open

fix: bundle gdk-pixbuf SVG loader in AppImage (#80)#81
manuacl wants to merge 1 commit into
am-will:mainfrom
manuacl:fix/issue-80-bundle-svg-loader

Conversation

@manuacl

@manuacl manuacl commented May 22, 2026

Copy link
Copy Markdown

Summary

The AppImage bundles libgdk_pixbuf-2.0 but not its SVG loader plugin. On hosts without rsvg-pixbuf-loader (e.g. Fedora 44+, which dropped the package), GTK4 cannot render symbolic SVG icons through gdk-pixbuf, leaving the four pane action icons (new terminal, new browser, split horizontal, split vertical) as broken-image placeholders.

This PR:

  • Bundles libpixbufloader-svg.so plus the librsvg-2 dependency closure into the AppImage at packaging time
  • Generates a relocatable loaders.cache.template; AppRun substitutes the live mount path at startup and writes the rendered cache under $XDG_CACHE_HOME/limux/ so it works on a read-only FUSE mount
  • Adds an assert_pixbuf_svg_loader_bundle smoke check that fails package.sh if any expected file is missing
  • Installs librsvg2-common in the Ubuntu CI workflows (release-linux.yml, release-rpm.yml) so the loader is available at packaging time

The .deb, .rpm, and tarball builds are unaffected — they pick the loader up from the host's librsvg2-common / rsvg-pixbuf-loader package via standard Depends/Requires.

Reproduction

On Bazzite (Fedora 44, NVIDIA open):

  • Before: 4 of 6 pane toolbar icons render as broken-image triangles
  • After: all 6 icons render correctly

A/B tested with two locally-built AppImages from the same main (with and without this patch) on the same Bazzite host.

Test plan

  • ./scripts/check.sh — passes (only known-baseline failing test mentioned in CLAUDE.md is unaffected)
  • ./scripts/package.sh — full build runs to completion, smoke check passes
  • Resulting AppImage launched on Bazzite Fedora 44 host — toolbar icons render
  • Baseline main AppImage launched on same host — toolbar icons broken (confirms the fix is required)

Closes #80

manuacl added a commit to manuacl/limux that referenced this pull request May 24, 2026
manuacl added a commit to manuacl/limux that referenced this pull request May 25, 2026
@manuacl manuacl force-pushed the fix/issue-80-bundle-svg-loader branch from 9be5526 to 8c167dd Compare May 25, 2026 14:55
The AppImage bundles libgdk_pixbuf-2.0 but not its SVG loader plugin.
On hosts without rsvg-pixbuf-loader (e.g. Fedora 44+, which dropped
the package), GTK4 cannot render symbolic SVG icons through gdk-pixbuf,
leaving the four pane action icons (new terminal, new browser, split
horizontal, split vertical) as broken-image placeholders.

Bundle libpixbufloader-svg.so plus the librsvg-2 dependency closure
into the AppImage and generate a relocatable loaders.cache template.
AppRun substitutes the live mount path at startup and writes the
rendered cache under $XDG_CACHE_HOME/limux/ so it works on a read-only
FUSE mount. Add an assert_pixbuf_svg_loader_bundle smoke check that
fails the build if any expected file is missing. Install
librsvg2-common in the Ubuntu CI workflows so the loader is available
at packaging time.

Multi-distro hardening:

* Replace `uname -m` with dpkg-architecture (preferred) or a
  case-mapped fallback, so 32-bit and armhf hosts resolve the correct
  Debian multiarch tuple (i386-linux-gnu, arm-linux-gnueabihf) instead
  of the bogus i686-linux-gnu / armv7l-linux-gnu. Adds the no-arch-infix
  /usr/lib/gdk-pixbuf-2.0/... path used by Arch.
* gdk-pixbuf-query-loaders lives under
  /usr/lib/<multiarch>/gdk-pixbuf-2.0/ on Debian/Ubuntu, not in $PATH —
  look there first, then fall back to PATH.
* Replace `exit 1` with `WARNING:` for missing libpixbufloader-svg.so
  or gdk-pixbuf-query-loaders. Local builds on hosts without
  rsvg-pixbuf-loader now succeed with a clear warning. The official CI
  workflows set LIMUX_REQUIRE_SVG_LOADER=1 to opt back into hard-fail.
* AppRun: only export GDK_PIXBUF_MODULE_FILE if mkdir AND sed succeed;
  use a per-PID cache filename to avoid concurrent-launch races.
* sed substitutions use a tab delimiter instead of `|`, so build paths
  or mount paths containing `|` no longer break the cache template.
* Add `scripts/tests/test-package-svg-loader.sh` — 13 shell unit-tests
  covering the multiarch mapping, sed delimiter behaviour, AppRun
  conditional export, and the LIMUX_REQUIRE_SVG_LOADER gate.

Documentation: add a CLAUDE.md Pitfalls entry so future maintainers
don't repeat the issue. The original symptom (broken icons) was easy
to miss because everything builds and runs — icons just degrade
silently to fallback glyphs.

E2E build verified on ubuntu:24.04 distrobox: AppImage produced,
loader bundled, smoke check passed, exit 0.

Closes am-will#80

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@manuacl manuacl force-pushed the fix/issue-80-bundle-svg-loader branch from 8c167dd to ff0af96 Compare May 26, 2026 08:04
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.

Pane action toolbar: 4 of 6 icons render as broken-image fallback (Fedora/Bazzite, v0.1.19 AppImage)

1 participant