Q about migration to core24/gnome-46

Hi everyone,

I’ve locally tried to test out a gtk4 app migration to core24 (changing core22->core24 and architectures->platforms), and got following messages in console:

libpxbackend-1.0.so: cannot open shared object file: No such file or directory
Failed to load module: /home/yvs/snap/pingpath/common/.cache/gio-modules/libgiolibproxy.so
/usr/share/libdrm/amdgpu.ids: No such file or directory

complains about amdgpu.ids there were always, but “No such” libpxbackend-1.0.so is a new one.

App build with core24 works despite those warnings, but anyway:
Is there something else that need to take into account for core24?
and, is it possible to have builds for core22 and core24 at the same time?

Thanks in advance for hints

I see these libpxbackend messages on my recently migrated snaps too. I haven’t had time to dig into what these are. I am going to summon @jamesh on that one.

Perhaps @Saviq or @zyga-snapd can provide more insight on the amdgpu.ids issue/warning.

/usr/share/libdrm/amdgpu.ids: No such file or directory

This should be handled by the gpu-2404 interface together with the GNOME extension adding the libdrm layout (actually it should have been for core22 as well):

Can you please post the output of these commands, substituting <snap> with your snap name?

$ snap connections <snap>
Interface          Plug             Slot                Notes
content[gpu-2404]  <snap>:gpu-2404  mesa-2404:gpu-2404  -
# ...

$ snap run --shell <snap> -c 'stat $SNAP/gpu-2404/libdrm/amdgpu.ids'
  File: /snap/<snap>/<rev>/gpu-2404/libdrm/amdgpu.ids
  Size: 17212           Blocks: 34         IO Block: 1024   regular file
Device: 7,3     Inode: 9           Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-01-13 09:37:07.000000000 +0000
Modify: 2024-01-13 09:37:07.000000000 +0000
Change: 2024-01-13 09:37:07.000000000 +0000
 Birth: -

$ snap run --shell <snap> -c 'stat /usr/share/libdrm/amdgpu.ids'
  File: /usr/share/libdrm/amdgpu.ids
  Size: 17212           Blocks: 34         IO Block: 1024   regular file
Device: 7,3     Inode: 9           Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-01-13 09:37:07.000000000 +0000
Modify: 2024-01-13 09:37:07.000000000 +0000
Change: 2024-01-13 09:37:07.000000000 +0000

If the first stat works, but the second one does not, that’s a SnapD bug being worked on right now (using layout: over an interface: content’s target:) . Rebooting / reinstalling the snap might help in this case.

Why would you want that? A big reason to use snaps is the fact you can build it once and run across Linux distributions, versions. You don’t need the snap matching the host OS at all.

for core24 build:

% snap connections pingpath
Interface               Plug                      Slot                            Notes
content[gnome-46-2404]  pingpath:gnome-46-2404    gnome-46-2404:gnome-46-2404     -
content[gpu-2404]       pingpath:gpu-2404         mesa-2404:gpu-2404              -
content[gtk-3-themes]   pingpath:gtk-3-themes     gtk-common-themes:gtk-3-themes  -
content[icon-themes]    pingpath:icon-themes      gtk-common-themes:icon-themes   -
content[sound-themes]   pingpath:sound-themes     gtk-common-themes:sound-themes  -
desktop                 pingpath:desktop          :desktop                        -
desktop-legacy          pingpath:desktop-legacy   :desktop-legacy                 -
gsettings               pingpath:gsettings        :gsettings                      -
network                 pingpath:network          :network                        -
network-observe         pingpath:network-observe  :network-observe                manual
network-status          pingpath:network-status   :network-status                 -
opengl                  pingpath:opengl           :opengl                         -
wayland                 pingpath:wayland          :wayland                        -
x11                     pingpath:x11              :x11                            -
% snap run --shell pingpath -c 'stat $SNAP/gpu-2404/libdrm/amdgpu.ids'

  File: /snap/pingpath/x1/gpu-2404/libdrm/amdgpu.ids
  Size: 17212     	Blocks: 34         IO Block: 1024   regular file
Device: 7,15	Inode: 261         Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-01-13 11:37:07.000000000 +0200
Modify: 2024-01-13 11:37:07.000000000 +0200
Change: 2024-01-13 11:37:07.000000000 +0200
 Birth: -
% snap run --shell pingpath -c 'stat /usr/share/libdrm/amdgpu.ids'
stat: cannot statx '/usr/share/libdrm/amdgpu.ids': No such file or directory

Rebooting / reinstalling the snap might help in this case.

unfortunately it isn’t fixed by reboot/reinstall (as well as with core22+gnome+amd)


actually it should have been for core22 as well

For core22 lets take gnome-calculataror as a reference:

% /snap/bin/gnome-calculator
/usr/share/libdrm/amdgpu.ids: No such file or directory
% snap connections gnome-calculator
Interface               Plug                             Slot                               Notes
content[gnome-42-2204]  gnome-calculator:gnome-42-2204   gnome-42-2204:gnome-42-2204        -
content[gtk-3-themes]   gnome-calculator:gtk-3-themes    gtk-common-themes:gtk-3-themes     -
content[icon-themes]    gnome-calculator:icon-themes     gtk-common-themes:icon-themes      -
content[sound-themes]   gnome-calculator:sound-themes    gtk-common-themes:sound-themes     -
dbus                    -                                gnome-calculator:gnome-calculator  -
desktop                 gnome-calculator:desktop         :desktop                           -
desktop-legacy          gnome-calculator:desktop-legacy  :desktop-legacy                    -
gsettings               gnome-calculator:gsettings       :gsettings                         -
network                 gnome-calculator:network         :network                           -
network-status          gnome-calculator:network-status  :network-status                    -
opengl                  gnome-calculator:opengl          :opengl                            -
wayland                 gnome-calculator:wayland         :wayland                           -
x11                     gnome-calculator:x11             :x11            

for core22 cases there’s the same pattern like one described for example here

probably it’s connected.

and, is it possible to have builds for core22 and core24 at the same time?

Why would you want that? A big reason to use snaps is the fact you can build it once and run across Linux distributions, versions. You don’t need the snap matching the host OS at all.

In general because older libs and frameworks are not so big and more likely will correctly work on old hardware.
In the case of core24-gnome46: gnome42(i.e. gtk4.12) uses usual gl by default, since gtk4.14 there’s gles by default and other default renderers ngl or vulkan (forgot which one is in gnome 4.6). So that an app based on core22+gnome42 could be used as a backup (or option) in case of rough edges with core24+gnome46.

p.s. it was just kinda a philosophical question on the way, let’s put it away

I can see the file in the snap as /snap/gnome-46-2404/current/usr/lib/x86_64-linux-gnu/libproxy/libpxbackend-1.0.so, which would not be on the regular library path.

It looks like libproxy.so sets DT_RUNPATH:

$ objdump -x /usr/lib/x86_64-linux-gnu/libproxy.so.1 | grep RUNPATH
  RUNPATH              /usr/lib/x86_64-linux-gnu/libproxy
$ objdump -x /usr/lib/x86_64-linux-gnu/libproxy.so.1 | grep NEEDED
  NEEDED               libpxbackend-1.0.so
  NEEDED               libgobject-2.0.so.0
  NEEDED               libglib-2.0.so.0

So that allows it to resolve libpxbackend-1.0.so when the library is installed to the location it was built for.

Updating the desktop-launch script to add $SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libproxy to LD_LIBRARY_PATH will likely fix the problem. You can probably verify this with your existing snap by calling snap run --shell command, updating LD_LIBRARY_PATH, then manually calling your command from within the sandbox shell.

1 Like

calling snap run --shell command, updating LD_LIBRARY_PATH, then manually calling your command from within the sandbox shell

true, with updated LD_LIBRARY_PATH there’s no complain on lack of ` libpxbackend-1.0.so’

Updating the desktop-launch script to add $SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libproxy to LD_LIBRARY_PATH will likely fix the problem

is it env update for desktop-launch to gnome-46-2404 snap? or it’s possible to add into environment by adding some parts to user snap yaml manifest?

1 Like

Yeah, it’s. Just add that under the apps.appName.env like

apps:
  appName:
    env:
      LD_LIBRARY_PATH: /path/to/add:${LD_LIBRARY_PATH}
1 Like

Just add that under the apps.appName.env like

yes, thanks, it (written as below) can be used as a workaround to get rid of that warning

apps:
  your-app-name:
    environment:
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP_DESKTOP_RUNTIME/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libproxy

Isn't it better to be at `gnome-46` extension level? (to not add it to each snap's yaml)
1 Like

I am sorry, I previously made a mistake with the environment key. BTW, I think we can fix it in some other way, like organizing the paths.

I am suggesting doing this within the gnome-46-2404 snap itself. This would automatically fix any snaps using the extension (even those built before the fix).

3 Likes

No worries at all. Your suggested option is helpful and can be used with a bit correction in other cases too (at least for testing out).

1 Like

@SergioCostas can you take care of this?

@sergiusens Yes, I’ll do it.

Also, about the amdgpu.ids, maybe we can add this little patch that I’m still waiting for it being merged in upstream, that allows to use an ENV to specify where to find the file. That way we can get rid of the layout: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/273

Ok, sent a patch… Fix libpxbackend not being found by sergio-costas · Pull Request #27 · snapcore/snapcraft-desktop-integration · GitHub