Subject: bug#75523: Sourcing GDK_PIXBUF_MODULE_FILE prevents icons of native applications on foreign systems to load

From: Simon Streit <[email-masked]>
Date: Sun, 12 Jan 2025 19:32:16 +0100

Hello,

if Guix is installed on a foreign system (Debian Bookworm), sourcing
GDK_PIXBUF_MODULE_FILE will prevent native applications on foreign
systems from loading their icons:

--8<---------------cut here---------------start------------->8---

user@host:~$ /usr/bin/nautilus
** Message: 18:24:36.710: Connecting to org.freedesktop.Tracker3.Miner.Files

(org.gnome.Nautilus:134621): Gtk-WARNING **: 18:24:36.915: Failed to load icon /org/gnome/nautilus/icons/scalable/actions/funnel-symbolic.svg: Unable to load image-loading module: /gnu/store/cip1g5lwcvrmwp57y0fxyzp6jamn4xjk-librsvg-2.58.5/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /gnu/store/cip1g5lwcvrmwp57y0fxyzp6jamn4xjk-librsvg-2.58.5/lib/librsvg-2.so.2)

...
--8<---------------cut here---------------end--------------->8---

I have a user profile with the following in .bashrc:

--8<---------------cut here---------------start------------->8---
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export GUIX_BUILD_OPTIONS="--cores=$(echo $(lscpu | grep ^Core) | awk '{print $4}')"
export GUIX_PROFILE="${HOME}/.config/guix/current"
. "${GUIX_PROFILE}/etc/profile"

eval $(guix package --search-paths=prefix)

# Manually sourcing it to be independent of gdk-pixbuf and/or librsvg
# being installed in the profile:
export GDK_PIXBUF_MODULE_FILE=".guix-profile/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
--8<---------------cut here---------------end--------------->8---

If GDK_PIXBUF_MODULE_FILE is explicitly sourced, then Guix based
applications show their icons.  If not, no icons are displayed and the
host has the ability restored to show icons.

This leaves Guix on foreign systems currently at: Either the foreign
system knows how to load icons, or Guix, if sourcing
GDK_PIXBUF_MODULE_FILE.  Not simultaneously.

This behaviour is somewhat similar in Guix Systems too and has had a
similar discussion before: [1].  There it was proposed to wrap the
applications to provide GDK_PIXBUF_MODULE_FILE directly.

But, there was a time where this was not a problem that lasted up to at
least commit 6da03fcc459f4475553f394354ef37c628f39f97.  I tried to
bisect my way into the past and find the offending change.
Unfortunately, I had to give up as trying to pull into commits around
August 2024 is close to impossible now.  Many commits failed on me and I
never got anywhere close to where that change happened.

Therefor I am opening this bug report hoping that someone will help me
figure out what is going on here?

I do remember reading a thread last year, where Maxim – CCed – discussed
a problem related to librsvg and gdk-pixbuf.  I only found an upstream
issue at [2].  But not the discussion on the lists here.

[1] https://issues.guix.gnu.org/63427
[2] https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/933/diffs?commit_id=2dba33bc1b752e2e6fbed3c78f1cec6a74dea201
[3] https://issues.guix.gnu.org/60434

Kind regards

-- 
Simon