nix-ld icon indicating copy to clipboard operation
nix-ld copied to clipboard

Failing on xournalpp?

Open tobiasBora opened this issue 1 year ago • 1 comments

Thanks for this great tool. But I'm a bit confused: I'd expect nix-ld to work also for appimages that I downloaded in https://github.com/xournalpp/xournalpp/releases, but it fails:

$ ./xournalpp-1.2.4+dev-nightly.20241107-x86_64.AppImage
Gtk-Message: 16:17:14.178: Failed to load module "colorreload-gtk-module"
Gtk-Message: 16:17:14.179: Failed to load module "window-decorations-gtk-module"
ALSA lib pcm.c:2793:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2793:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2793:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
xopp-Message: 16:17:14.384: Plugin "MigrateFontSizes" UI initialized

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.392: Could not load image 'pixmaps/com.github.xournalpp.xournalpp.svg': Unable to load image-loading module: libpixbufloader-svg.so: libpixbufloader-svg.so: cannot open shared object file: No such file or directory

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.680: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.703: im-ibus.so: cannot open shared object file: No such file or directory

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.703: Loading IM context type 'ibus' failed

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.703: cache version is different 1 != 2

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.813: im-ibus.so: cannot open shared object file: No such file or directory

(com.github.xournalpp.xournalpp:742328): Gtk-WARNING **: 16:17:14.813: Loading IM context type 'ibus' failed
**
Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /nix/store/9dlny4xviyp4sjlq93s7k99374xpf6qg-breeze-icons-6.7.0/share/icons/breeze-dark/status/24/image-missing.svg: Impossible de charger le module de chargement d’images : libpixbufloader-svg.so : libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /nix/store/9dlny4xviyp4sjlq93s7k99374xpf6qg-breeze-icons-6.7.0/share/icons/breeze-dark/status/24/image-missing.svg: Impossible de charger le module de chargement d’images : libpixbufloader-svg.so : libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)

(com.github.xournalpp.xournalpp:742328): xopp-WARNING **: 16:17:15.029: [Crash Handler] Crashed with signal 6

(com.github.xournalpp.xournalpp:742328): xopp-WARNING **: 16:17:15.029: [Crash Handler] Wrote crash log to: /home/leo/.cache/xournalpp/errorlogs/errorlog.20241108-161715.log

(com.github.xournalpp.xournalpp:742328): xopp-WARNING **: 16:17:15.273: Essai d'un enregistrement d'urgence du document ouvert...

(com.github.xournalpp.xournalpp:742328): xopp-WARNING **: 16:17:15.273: Document enregistré avec succès dans "/home/leo/.config/xournalpp/emergencysave.xopp "

I do see errors related to ibus.so and libpixbufloader-svg.so, but I have them enabled already:

  # Automatically creates a loader in /lib/* to avoid patching stuff
  # To disable it temporarily use
  # unset NIX_LD
  programs.nix-ld = {
    enable = true;
    libraries = with pkgs; [
      # List by default
      zlib
      zstd
      stdenv.cc.cc
      curl
      openssl
      attr
      libssh
      bzip2
      libxml2
      acl
      libsodium
      util-linux
      xz
      systemd

      # My own additions
	    xorg.libXcomposite
      xorg.libXtst
      xorg.libXrandr
      xorg.libXext
      xorg.libX11
      xorg.libXfixes
      libGL
      libva
      pipewire
      xorg.libxcb
      xorg.libXdamage
      xorg.libxshmfence
      xorg.libXxf86vm
      libelf
      
      # Required
      glib
      gtk2
      
      # Without these it silently fails
      xorg.libXinerama
      xorg.libXcursor
      xorg.libXrender
      xorg.libXScrnSaver
      xorg.libXi
      xorg.libSM
      xorg.libICE
      gnome2.GConf
      nspr
      nss
      cups
      libcap
      SDL2
      libusb1
      dbus-glib
      ffmpeg
      # Only libraries are needed from those two
      libudev0-shim

      # needed to run unity
      gtk3
      icu
      libnotify
      gsettings-desktop-schemas
      # https://github.com/NixOS/nixpkgs/issues/72282
      # https://github.com/NixOS/nixpkgs/blob/2e87260fafdd3d18aa1719246fd704b35e55b0f2/pkgs/applications/misc/joplin-desktop/default.nix#L16
      # log in /home/leo/.config/unity3d/Editor.log
      # it will segfault when opening files if you don’t do:
      # export XDG_DATA_DIRS=/nix/store/0nfsywbk0qml4faa7sk3sdfmbd85b7ra-gsettings-desktop-schemas-43.0/share/gsettings-schemas/gsettings-desktop-schemas-43.0:/nix/store/rkscn1raa3x850zq7jp9q3j5ghcf6zi2-gtk+3-3.24.35/share/gsettings-schemas/gtk+3-3.24.35/:$XDG_DATA_DIRS
      # other issue: (Unity:377230): GLib-GIO-CRITICAL **: 21:09:04.706: g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
      
      # Verified games requirements
      xorg.libXt
      xorg.libXmu
      libogg
      libvorbis
      SDL
      SDL2_image
      glew110
      libidn
      tbb
      
      # Other things from runtime
      flac
      freeglut
      libjpeg
      libpng
      libpng12
      libsamplerate
      libmikmod
      libtheora
      libtiff
      pixman
      speex
      SDL_image
      SDL_ttf
      SDL_mixer
      SDL2_ttf
      SDL2_mixer
      libappindicator-gtk2
      libdbusmenu-gtk2
      libindicator-gtk2
      libcaca
      libcanberra
      libgcrypt
      libvpx
      librsvg
      xorg.libXft
      libvdpau
      # ...
      # Some more libraries that I needed to run programs
      gnome2.pango
      cairo
      atk
      gdk-pixbuf
      fontconfig
      freetype
      dbus
      alsaLib
      expat
      # Needed for electron
      libdrm
      mesa
      libxkbcommon
      # Needed to run, via virtualenv + pip, matplotlib & tikzplotlib
      stdenv.cc.cc.lib # to provide libstdc++.so.6
      pkgs.gcc-unwrapped.lib # maybe only the first one needed

      # needed to run appimages
      fuse # needed for musescore 4.2.1 appimage
      e2fsprogs # needed for musescore 4.2.1 appimage
      fribidi # needed for xournalpp (nightly 08/11/2024)
      librsvg # needed for xournalpp (nightly)
      ibus # needed for xournalpp (nightly)
    ];
  };  
  

On the other hand, appimage-run works better (at least I can start the program).

I can't really explain this bug, so sorry if this is unrelated, but since appimage-run kinds of work, I thought it would be a nix-ld related bug. Tested on kde plasma 6, wayland, recent nixos unstable.

tobiasBora avatar Nov 08 '24 15:11 tobiasBora

You can restart xournalpp with LD_DEBUG=libs set as environment variables. Than glibc will tell you exactly in which directories it has been trying to lookup your library. Hopefully this will make it obvious why it can't load from /run/current-system/sw/share/nix-ld/lib/. Also make sure you are testing with nix-ld > v2.0.0 as it has changed significantly it's implementation.

Mic92 avatar Nov 09 '24 08:11 Mic92

Thanks (sorry for my long answer I missed your message) using this binary https://github.com/xournalpp/xournalpp/releases/download/v1.2.4/xournalpp-1.2.4-x86_64.AppImage. So I tried again, and it seems like it struggle with libpixbufloader-svg.so:

(com.github.xournalpp.xournalpp:1546746): Gtk-WARNING **: 15:47:35.215: Loading IM context type 'uim' failed
1546746:     find library=libpixbufloader-svg.so [0]; searching
1546746:      search path=/etc/sane-libs:/nix/store/y6bg8kbly9p7wyp0hyyqddgbjvxlpcjd-pipewire-1.4.2-jack/lib:/run/current-system/sw/share/nix-ld/lib         (LD_LIBRARY_PATH)
1546746:       trying file=/etc/sane-libs/libpixbufloader-svg.so
1546746:       trying file=/nix/store/y6bg8kbly9p7wyp0hyyqddgbjvxlpcjd-pipewire-1.4.2-jack/lib/libpixbufloader-svg.so
1546746:       trying file=/run/current-system/sw/share/nix-ld/lib/libpixbufloader-svg.so
1546746:      search path=/nix/store/bkpj51fz88rbyjd60i6lrp0xdax1b24g-glib-2.84.1/lib                (RUNPATH from file /run/current-system/sw/share/nix-ld/lib/libgtk-3.so.0)
1546746:       trying file=/nix/store/bkpj51fz88rbyjd60i6lrp0xdax1b24g-glib-2.84.1/lib/libpixbufloader-svg.so
1546746:      search path=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib              (system search path)
1546746:       trying file=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpixbufloader-svg.so
1546746:      search cache=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/etc/ld.so.cache
1546746:      search path=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib:/nix/store/za53jjhjl1xajv3y1zpjvr9mh4w0c1ay-xgcc-14.2.1.20250322-libgcc/lib          (system search path)
1546746:       trying file=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpixbufloader-svg.so
1546746:       trying file=/nix/store/za53jjhjl1xajv3y1zpjvr9mh4w0c1ay-xgcc-14.2.1.20250322-libgcc/lib/libpixbufloader-svg.so
1546746:
1546746:     find library=libpixbufloader-svg.so [0]; searching
1546746:      search path=/etc/sane-libs:/nix/store/y6bg8kbly9p7wyp0hyyqddgbjvxlpcjd-pipewire-1.4.2-jack/lib:/run/current-system/sw/share/nix-ld/lib         (LD_LIBRARY_PATH)
1546746:       trying file=/etc/sane-libs/libpixbufloader-svg.so
1546746:       trying file=/nix/store/y6bg8kbly9p7wyp0hyyqddgbjvxlpcjd-pipewire-1.4.2-jack/lib/libpixbufloader-svg.so
1546746:       trying file=/run/current-system/sw/share/nix-ld/lib/libpixbufloader-svg.so
1546746:      search path=/nix/store/bkpj51fz88rbyjd60i6lrp0xdax1b24g-glib-2.84.1/lib                (RUNPATH from file /run/current-system/sw/share/nix-ld/lib/libgtk-3.so.0)
1546746:       trying file=/nix/store/bkpj51fz88rbyjd60i6lrp0xdax1b24g-glib-2.84.1/lib/libpixbufloader-svg.so
1546746:      search path=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib              (system search path)
1546746:       trying file=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpixbufloader-svg.so
1546746:      search cache=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/etc/ld.so.cache
1546746:      search path=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib:/nix/store/za53jjhjl1xajv3y1zpjvr9mh4w0c1ay-xgcc-14.2.1.20250322-libgcc/lib          (system search path)
1546746:       trying file=/nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpixbufloader-svg.so
1546746:       trying file=/nix/store/za53jjhjl1xajv3y1zpjvr9mh4w0c1ay-xgcc-14.2.1.20250322-libgcc/lib/libpixbufloader-svg.so
1546746:
**
Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /nix/store/wyjgkavzidsxa2v1klwald80120s2z10-breeze-icons-6.14.0/share/icons/breeze-dark/status/24/image-missing.svg: Unable to load image-loading module: libpixbufloader-svg.so: libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /nix/store/wyjgkavzidsxa2v1klwald80120s2z10-breeze-icons-6.14.0/share/icons/breeze-dark/status/24/image-missing.svg: Unable to load image-loading module: libpixbufloader-svg.so: libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)

(com.github.xournalpp.xournalpp:1546746): xopp-WARNING **: 15:47:35.382: [Crash Handler] Crashed with signal 6

But I can't find any nix package that distributes libpixbufloader-svg.so at its root… but it does appear in some appimage-related stuff like:

$ nix run github:nix-community/nix-index-database -- libpixbufloader-svg.so
(xlights.out)                                    17,984 r /nix/store/d4mp2pndpnip8pi7lzkp0cpqbwh637lf-xlights-2025.06-extracted/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
(xlights.out)                                         0 s /nix/store/d4mp2pndpnip8pi7lzkp0cpqbwh637lf-xlights-2025.06-extracted/usr/lib/libpixbufloader-svg.so
(jet-pilot.out)                                       0 s /nix/store/cp6046qqpw8pxislrh6qxd8vf0ycmrhx-jet-pilot-1.35.0-extracted/usr/lib/libpixbufloader-svg.so
(jet-pilot.out)                                  18,032 r /nix/store/cp6046qqpw8pxislrh6qxd8vf0ycmrhx-jet-pilot-1.35.0-extracted/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
(hoppscotch.out)                                      0 s /nix/store/g9122dqchjhrrl4zf27wsaj6152zxnvr-hoppscotch-25.6.0-0-extracted/usr/lib/libpixbufloader-svg.so
(hoppscotch.out)                                 18,032 r /nix/store/g9122dqchjhrrl4zf27wsaj6152zxnvr-hoppscotch-25.6.0-0-extracted/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
(cura-appimage.out)                              14,360 r /nix/store/hxlz1hk8izn0wjc94cy77v6k9k3scl1i-cura-appimage-tools-output-5.10.1-extracted/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
(clash-nyanpasu.out)                                  0 s /nix/store/j1xvby4jdkwv028czc24qv6j1lj2wjkr-clash-nyanpasu-1.6.1-extracted/usr/lib/libpixbufloader-svg.so
(clash-nyanpasu.out)                             18,032 r /nix/store/j1xvby4jdkwv028czc24qv6j1lj2wjkr-clash-nyanpasu-1.6.1-extracted/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so

So I guess it may be a library only packaged by appimage?

tobiasBora avatar Jul 06 '25 13:07 tobiasBora

~/git/nixpkgs fix-perf 13s % nix-shell -p librsvg.out

[nix-shell:~/git/nixpkgs]$ find $buildInputs/ /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/ /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/bin /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/bin/rsvg-convert /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/librsvg-2.2.dylib /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/gdk-pixbuf-2.0 /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0 /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.dylib /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/girepository-1.0 /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/girepository-1.0/Rsvg-2.0.typelib /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/lib/librsvg-2.dylib /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/man /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/man/man1 /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/man/man1/rsvg-convert.1.gz /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/thumbnailers /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/thumbnailers/librsvg.thumbnailer /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/zsh /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/zsh/site-functions /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/zsh/site-functions/_rsvg-convert /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/fish /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/fish/vendor_completions.d /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/fish/vendor_completions.d/rsvg-convert.fish /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/bash-completion /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/bash-completion/completions /nix/store/w4niv0fx0i5ga0fy3gfi7q64b1l22h6r-librsvg-2.60.0/share/bash-completion/completions/rsvg-convert.bash

Mic92 avatar Jul 06 '25 15:07 Mic92

nix-shell -p librsvg.out

Not sure what you mean, I tried both to add librsvg in nix-ld and in current shell, no luck.

tobiasBora avatar Jul 06 '25 19:07 tobiasBora

Is /run/current-system/sw/share/nix-ld/lib/libpixbufloader-svg.so present on your system?

Mic92 avatar Jul 06 '25 20:07 Mic92

No, is it the case for you? I don't even see which package is supposed to provide this lib given that nix run github:nix-community/nix-index-database -- lib/libpixbufloader-svg.so --top-level returns zero element. Also, the packages returned by this command without lib and --top-level do suggest that libpixbufloader-svg.so may be contained in /lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so so I tried to check:

$ ls /run/current-system/sw/share/nix-ld/lib/gdk-pixbuf-2.0/2.10.0/loaders | grep svg
libpixbufloader_svg.so

and as you can see there is no libpixbufloader-svg.so but there is libpixbufloader_svg.so (with an underscore, explaining also why nix-index-database does not list librsvg).

To further understand this bug, I tried to run find /nix/store -name 'libpixbufloader-svg.so' and find /nix/store -name 'libpixbufloader-svg.so', and this seems that they renamed it with the underscore starting around librsvg 2.59 (2.57 still uses the dash). So I continued to inverstigate and found https://www.linuxquestions.org/questions/showthread.php?s=b59e66de3502b2f0e8e25a97408036fb&p=6555519#post6555519 that says that it is a recent change, but that it should not matter:

The underscore is still there, but because the install script runs update-gdk-pixbuf-loaders it no longer matters what the name is. It should be found correctly in any case.

So not sure why with nix-ld it is note the case… this starts to be at the edge of my understanding of shared libraries ^^

tobiasBora avatar Jul 07 '25 08:07 tobiasBora

I think this is rather incompatibility between nixpkgs's version of rsvg and what xournalpp expects. You can create a symlink using pkgs.runCommand from the underscore version to the right one (assuming the ABI version in nixpkgs has everything xournalpp expects). nix-ld hand over control correctly to glibc and this is a matter of making the right libraries available in /run/current-system/sw/share/nix-ld/lib

Mic92 avatar Jul 07 '25 09:07 Mic92

So I tried

      (runCommand "librsvg" {} ''
        mkdir -p $out/lib/gdk-pixbuf-2.0/2.10.0/loaders
        ln -s "${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so" "$out/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so"
        ln -s "${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so" "$out/lib/libpixbufloader-svg.so"
      '')

and the first link does not work, while the second does work… But I've no idea why I need to do that and this seems more like a hack, since, no other distribution seems to put the libpixbufloader_svg in /lib directly, they all stay in loaders and then stuff like gdk-pixbuf-query-loaders seems to take care of finding the lib in this folder:

   gdk-pixbuf-query-loaders collects information about loadable modules for gdk-pixbuf and writes it to the
  default cache file location, or to stdout.

  If called without arguments, it looks for modules in the gdk-pixbuf loader directory.

  If called with arguments, it looks for the specified modules. The arguments may be absolute or relative
  paths.

  Normally, the output of gdk-pixbuf-queryloaders is written to libdir/gdk-pixbuf-2.0/2.10.0/loaders.cache,
  where gdk-pixbuf looks for it by default. If it is written to some other location, the environment
  variable GDK_PIXBUF_MODULE_FILE can be set to point gdk-pixbuf at the file.

So I don't know if I just forgot to install something important, if the packagers of librsvg forgot to run gdk-pixbuf-query-loaders to create the cache file, if nix-ld should be aware of/use gdk-pixbuf-query-loaders to automatically detect the loaders/create the cache…

tobiasBora avatar Jul 07 '25 09:07 tobiasBora

And I also don't know if it is related, but while the latest musescore works with nix-ld, the 4.2.1 (working with appimage-run) does not start with nix-ld with this error:


(mscore4portable:1589146): GLib-GIO-ERROR **: 11:52:20.580: No GSettings schemas are installed on the system
[1589191:1589191:20250707,115220.586609:WARNING thread_snapshot_linux.cc:111] Unknown scheduling policy 1073741824
[1589191:1589191:20250707,115220.589680:ERROR elf_dynamic_array_reader.h:61] tag not found
[…]
[1589191:1589191:20250707,115220.594750:ERROR elf_dynamic_array_reader.h:61] tag not found
[1589191:1589191:20250707,115220.594772:ERROR elf_dynamic_array_reader.h:61] tag not found
[1589191:1589191:20250707,115220.594831:ERROR elf_dynamic_array_reader.h:61] tag not found
[1589191:1589192:20250707,115220.711332:ERROR http_transport_socket.cc:164] SSL_connect
[1589191:1589192:20250707,115220.711347:ERROR http_transport_socket.cc:572] SSLStream Initialize
/tmp/nix-shell-1542326-0/nix-shell-1554218-0/.mount_MuseScFCybPI/AppRun : ligne 26 : 1589146 Trace/breakpoint trap   (core dumped)"${APPDIR}/bin/mscore4portable" "$@"

with the debug:

:
   1590597:
   1590597:     calling init: /nix/store/w762xfdg6qkyamncs8s33m182n45nmma-dav1d-1.5.1/lib/libdav1d.so.7
   1590597:
   1590597:
   1590597:     calling init: /run/current-system/sw/share/nix-ld/lib/librsvg-2.so.2
   1590597:
   1590597:
   1590597:     calling init: /nix/store/14spdmgq38vmzywkkm65s65ab6923y6p-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so
   1590597:
   1590597:     /nix/store/14spdmgq38vmzywkkm65s65ab6923y6p-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so: error: symbol lookup error: undefined symbol: g_module_check_init (fatal)
   1590597:     /nix/store/14spdmgq38vmzywkkm65s65ab6923y6p-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so: error: symbol lookup error: undefined symbol: g_module_unload (fatal)
   1590597:
   1590597:     calling init: /nix/store/42dlyn8qbxdp55gxd35xymik0nhy0hdw-gtk+3-3.24.49/lib/gtk-3.0/3.0.0/immodules/im-wayland.so
   1590597:
   1590597:     /nix/store/42dlyn8qbxdp55gxd35xymik0nhy0hdw-gtk+3-3.24.49/lib/gtk-3.0/3.0.0/immodules/im-wayland.so: error: symbol lookup error: undefined symbol: g_module_check_init (fatal)
   1590597:     /nix/store/42dlyn8qbxdp55gxd35xymik0nhy0hdw-gtk+3-3.24.49/lib/gtk-3.0/3.0.0/immodules/im-wayland.so: error: symbol lookup error: undefined symbol: g_module_unload (fatal)

(mscore4portable:1590597): GLib-GIO-ERROR **: 11:55:47.811: No GSettings schemas are installed on the system
[1590613:1590613:20250707,115547.817646:WARNING thread_snapshot_linux.cc:111] Unknown scheduling policy 1073741824
[1590613:1590613:20250707,115547.820742:ERROR elf_dynamic_array_reader.h:61] tag not found
[1590613:1590613:20250707,115547.821396:ERROR elf_dynamic_array_reader.h:61] tag not found
[1590613:1590613:20250707,115547.823097:ERROR elf_dynamic_array_reader.h:61] tag not found
[1590613:1590613:20250707,115547.823153:ERROR elf_dynamic_array_reader.h:61] tag not found
[1590613:1590613:20250707,115547.823263:ERROR elf_dynamic_array_reader.h:61] tag not found
[1590613:1590613:20250707,115547.823320:ERROR elf_dynamic_array_reader.h:61] tag not found

tobiasBora avatar Jul 07 '25 09:07 tobiasBora

Don't know how gdk-pixbuf-query-loaders works to be honest.

Mic92 avatar Jul 07 '25 10:07 Mic92

We seem to have a cache in nixpkgs? modules/programs/gdk-pixbuf.nix It sets GDK_PIXBUF_MODULE_FILE

Mic92 avatar Jul 07 '25 10:07 Mic92

We seem to have a cache in nixpkgs? modules/programs/gdk-pixbuf.nix It sets GDK_PIXBUF_MODULE_FILE

Indeed… in my case it points to a file containing:

[…]
# GdkPixbuf Image Loader Modules file
# Automatically generated file, do not edit
# Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.42.12
#
# LoaderDir = /nix/store/14spdmgq38vmzywkkm65s65ab6923y6p-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders
#
"/nix/store/14spdmgq38vmzywkkm65s65ab6923y6p-librsvg-2.60.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so"
"svg" 6 "gdk-pixbuf" "Scalable Vector Graphics" "LGPL"
"image/svg+xml" "image/svg" "image/svg-xml" "image/vnd.adobe.svg+xml" "text/xml-svg" "image/svg+xml-compressed" ""
"svg" "svgz" "svg.gz" ""
" <svg" "*    " 100
" <!DOCTYPE svg" "*             " 100

suggesting that other programs should pick this one, even with the underscore… Not sure why xournal don't when using nix-ld. (I tried also a more recent version, same issue)

tobiasBora avatar Jul 07 '25 13:07 tobiasBora