Curious GTk issue with Anydesk / svg pixbuf loader

Hello Nixers,
hope to choose the right category… After my latest update (relevant
changes potentially happen few days ago since I update today after
a week) anydesk package seems to be broken due to a GTk issue I do not
understand…

I think the error is there (strace output, running anydesk)

openat(AT_FDCWD, "$(echo /nix/store/5xbmbiynhpyq59bxwa7xw4hszkh6fgz6-librsvg-2.42.4/lib/gdk-pixbuf-2.0/*/loaders.cache)", O_RDONLY) = -1 ENOENT (No such file or directory)

I imaging openat does not execute the subshell but simply try to open a
‘$(echo …’ file that of course not exists, but I do not know how make
the proper substitution happen before openat call…

For “environment” I have in my config since ever

  GDK_PIXBUF_MODULE_FILE = "$(echo ${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)";

and normally GTk apps can load svg icons issueless, and they still do
now. I also have gdk-pixbuf-query-loaders binary, actually as

/nix/store/05smyn5mn42xl1vfkyinqlahwcds5a3f-gdk-pixbuf-2.38.0-dev/bin/gdk-pixbuf-query-loaders

Running anydesk result in

(process:19467): GdkPixbuf-WARNING **: 11:11:19.119: Cannot open pixbuf loader module file '$(echo /nix/store/5xbmbiynhpyq59bxwa7xw4hszkh6fgz6-librsvg-2.42.4/lib/gdk-pixbuf-2.0/*/loaders.cache)': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > $(echo /nix/store/5xbmbiynhpyq59bxwa7xw4hszkh6fgz6-librsvg-2.42.4/lib/gdk-pixbuf-2.0/*/loaders.cache)
to make things work again for the time being.
terminate called after throwing an instance of 'base::gdk_exception_t'

file say

file /nix/store/5xbmbiynhpyq59bxwa7xw4hszkh6fgz6-librsvg-2.42.4/lib/gdk-pixbuf-2.0/*/loaders.cache
/nix/store/5xbmbiynhpyq59bxwa7xw4hszkh6fgz6-librsvg-2.42.4/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache: ASCII text

And both gdk-pixbuf-query-loaders and already created file are
essentially the same not counting autogenerated comments.

Does anyone have an idea?

A quick search reveal few similar issues in the past, like [1] but they
seems “already there” for anydesk…

If it’s relevant I’m on NixOS stable with few unstable pkgs added, my DE
is EXWM launched via LightDM…

Thanks for now!

[1] package key-mon is broken · Issue #11183 · NixOS/nixpkgs · GitHub

– Ingmar

Hmm, I would not expect environment.variables.GDK_PIXBUF_MODULE_FILE = "$(echo ${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)"; to
work at all, but apparently the variables are not escaped at all:
https://github.com/NixOS/nixpkgs/blob/5bae6dea205144bbf2689a42fdbbf490745d52f4/nixos/modules/config/shells-environment.nix#L12-L28;
I do not see any relevant changes in the module either.

It would be much better to use the new gdk-pixbuf module from unstable:
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ]; You
can cherry-pick Use a NixOS module for generating the gdk-pixbuf loaders cache. by ambrop72 · Pull Request #42562 · NixOS/nixpkgs · GitHub

Hi,

Hmm, I would not expect environment.variables.GDK_PIXBUF_MODULE_FILE = "$(echo ${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)"; to
work at all, but apparently the variables are not escaped at all:
Mh, actually saying it does work is a big exaggerated since I simply
use it in the past and left in my config to properly see icons for
Udiskie and ClipIt, after that icons shows properly and keep working
so I say “hey, it work” without testing removal…

It would be much better to use the new gdk-pixbuf module from unstable:
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ]; You
can cherry-pick Use a NixOS module for generating the gdk-pixbuf loaders cache. by ambrop72 · Pull Request #42562 · NixOS/nixpkgs · GitHub
Thanks, it does work now, despite only if run via sudo, but I think
that’s another issue… That’s nice however, I hope it will be merged
on stable :slight_smile:

Thanks again,
– Ingmar