Up-to-date Test Snap

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Message
Author
cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#256 Post by cengique »

cengique wrote: Sun Sep 03, 2023 7:10 pm Still can't get it to find the libraries though. :(
Latest update: Got it to work with these updates to snapcraft.yaml, but I'm not if they're overkill:

Code: Select all

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 17ca3876d..f52fd8dcd 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -20,7 +20,7 @@ apps:
     plugs: [home, pulseaudio, opengl, network, screen-inhibit-control, browser-support, x11]
     desktop: usr/share/applications/org.freeorion.FreeOrion.desktop
     environment:
-      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion
+      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}
       LIBGL_DRIVERS_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/dri
       # PYTHONPATH: $SNAP/usr/lib/python3.6
   ### freeorion-godot:
@@ -37,13 +37,13 @@ apps:
     command: usr/bin/freeoriond
     plugs: [home, network, network-bind]
     environment:
-      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion
+      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}:$SNAP_DESKTOP_RUNTIME/usr/lib/${CRAFT_ARCH_TRIPLET}
       #PYTHONPATH: $SNAP/usr/lib/python3.6
   freeoriond-dedicated:
     command: usr/bin/freeoriond --hostless --network.server.unconn-human-empire-players.max 0 --network.server.conn-human-empire-players.min 0
     plugs: [home, network, network-bind]
     environment:
-      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion
+      LD_LIBRARY_PATH: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/freeorion:$SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}:$SNAP_DESKTOP_RUNTIME/usr/lib/${CRAFT_ARCH_TRIPLET}
       #PYTHONPATH: $SNAP/usr/lib/python3.6
 
 layout:
@@ -113,7 +113,7 @@ parts:
       - mesa-utils
       - libgl1-mesa-dri
       # - python3
-      # - libpython3.8
+      - libpython3.8
       - libboost-date-time1.71.0
Should I send a pull request to branch release-v0.5?

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#257 Post by Ophiuchus »

released weekly build (also to slow game) and a new v0.5 build

Code: Select all

Track    Arch    Channel                                          Version                   Revision    Progress    Expires at
latest   amd64   stable                                           v0.5                      352         -           -
                 candidate                                        ↑                         ↑           -           -
                 beta                                             2023-09-05.8b4e2e8e9      385         -           -
                 edge                                             v0.5-23-g8cf5e31e2        386         -           -
                 beta/slow-game-025                               2023-09-05.8b4e2e8e9      385         -           2023-10-05T00:00:00Z
         i386    stable                                           v0.4.10.1                 216         -           -
v0.5.0   amd64   stable                                           v0.5                      352         -           -
                 candidate                                        ↑                         ↑           -           -
                 beta                                             v0.5-23-g8cf5e31e2        386         -           -
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#258 Post by Ophiuchus »

General Info: Just to let you know, I am considering basing the snap on a newer base, which would allow to let the player install more recent (like steam) and fitting (like nvidia) drivers via snap.

Starting point is the interface as mentioned at https://snapcraft.io/mesa-core22 (note that gaming-graphics-core22 is the one used by steam)

Also relevant could be graphics-test-tools and gaming-graphics-test snap described at https://github.com/canonical/gaming-graphics-test
cengique wrote: Sun Sep 03, 2023 9:28 pm Should I send a pull request to branch release-v0.5?
not sure. I am confused as why you need those changes to build.

Does the v0.5/beta from snapcraft.io work for you?

I usually use the build infrastructure at snapcraft to build. I'll try to start a local build here to reproduce your case
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#259 Post by cengique »

Ophiuchus wrote: Wed Sep 06, 2023 4:35 pm not sure. I am confused as why you need those changes to build.

Does the v0.5/beta from snapcraft.io work for you?

I usually use the build infrastructure at snapcraft to build. I'll try to start a local build here to reproduce your case
Just to clarify, I'm getting library error when I install the snaps from snapcraft.io. I had to build them manually to get around the error.

I actually checked the /snap mounts and the libraries are indeed missing until I add them to the stage-packages section in snapcraft.yaml. Then I still have to add them to the LD_LIBRARY_PATH so they are found.

I also only get the errors when I run the freeoriond server binary and not the freeorion game client I get the errors for both v0.5.0/stable and v0.5.0/beta:

Code: Select all

$ freeorion.freeoriond
/snap/freeorion/352/usr/bin/freeoriond: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
$ freeorion.freeoriond
/snap/freeorion/386/usr/bin/freeoriond: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
This is happening on both Manjaro and Debian systems. Are you saying that you don't have this error? Is it possible that it's finding those libraries from your system? I'm at Python 3.10+ so 3.8 libraries are not on my systems.

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#260 Post by Ophiuchus »

not sure what is happening on your system.

the v0.5/beta snap works fine for me on debian, ubuntu and fedora
cengique wrote: Fri Sep 08, 2023 4:05 am I actually checked the /snap mounts and the libraries are indeed missing
there should be the python3.8 both in the core and the gnome content snap. (Not sure why the gnome snap repackages the python though - it is not intended to run with a "wrong" core)

if i enter v0.5/beta on my debian bookworm

Code: Select all

ophi@bookworm:~$ snap run --shell freeorion
:~$ find /[^d]* -iname "*python3.11*" 2>/dev/null
:~$ which python3.8
/usr/bin/python3.8
:~$ echo $PYTHONPATH
/snap/freeorion/386/gnome-platform/usr/lib/python3.8:/snap/freeorion/386/gnome-platform/usr/lib/python3/dist-packages
on the host system, only python 3.11.2 is installed; no python 3.8
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#261 Post by cengique »

Ophiuchus wrote: Fri Sep 08, 2023 8:35 am not sure what is happening on your system.

the v0.5/beta snap works fine for me on debian, ubuntu and fedora

there should be the python3.8 both in the core and the gnome content snap. (Not sure why the gnome snap repackages the python though - it is not intended to run with a "wrong" core)
Interesting. Here's some more investigation results on my Manjaro system:

Code: Select all

$ snap list
Name               Version                     Rev    Tracking       Publisher   Notes
bare               1.0                         5      latest/stable  canonical✓  base
code               8b617bd0                    138    latest/stable  vscode✓     classic
core               16-2.60.2                   15925  latest/stable  canonical✓  core
core18             20230703                    2790   latest/stable  canonical✓  base
core20             20230801                    2015   latest/stable  canonical✓  base
core22             20230801                    864    latest/stable  canonical✓  base
freeorion          v0.5-23-g8cf5e31e2          386    v0.5.0/beta    agrrr3      -
gnome-3-28-1804    3.28.0-19-g98f9e67.98f9e67  198    latest/stable  canonical✓  -
gnome-3-38-2004    0+git.efb213a               143    latest/stable  canonical✓  -
gnome-42-2204      0+git.ff35a85               126    latest/stable  canonical✓  -
gtk-common-themes  0.1-81-g442e511             1535   latest/stable  canonical✓  -
multipass          1.12.2                      10244  latest/stable  canonical✓  -
skype              8.103.0.208                 296    latest/stable  skype✓      -
snapcraft          7.5.2                       9542   latest/stable  canonical✓  classic

$ snap run --shell freeorion
$ find /[^d]* -iname "libpython3.8*" 2>/dev/null
[snip outside directories]
/snap/snapcraft/9542/usr/share/doc/libpython3.8-minimal
/snap/snapcraft/9542/usr/share/doc/libpython3.8-stdlib
/snap/snapcraft/9542/usr/share/lintian/overrides/libpython3.8-minimal
/snap/snapcraft/9542/usr/share/lintian/overrides/libpython3.8-stdlib
/snap/gnome-3-38-2004/143/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
/snap/gnome-3-38-2004/143/usr/lib/x86_64-linux-gnu/libpython3.8.so
/snap/gnome-3-38-2004/143/usr/lib/x86_64-linux-gnu/libpython3.8.so.1
/snap/gnome-3-38-2004/143/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
/snap/gnome-3-38-2004/143/usr/share/lintian/overrides/libpython3.8
/snap/freeorion/386/gnome-platform/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
/snap/freeorion/386/gnome-platform/usr/lib/x86_64-linux-gnu/libpython3.8.so
/snap/freeorion/386/gnome-platform/usr/lib/x86_64-linux-gnu/libpython3.8.so.1
/snap/freeorion/386/gnome-platform/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
/snap/freeorion/386/gnome-platform/usr/share/lintian/overrides/libpython3.8
/snap/core20/2015/usr/share/doc/libpython3.8-minimal
/snap/core20/2015/usr/share/doc/libpython3.8-stdlib
/snap/core20/2015/usr/share/lintian/overrides/libpython3.8-minimal
/snap/core20/2015/usr/share/lintian/overrides/libpython3.8-stdlib
[snip outside directories]

$ echo $PYTHONPATH
/snap/freeorion/386/gnome-platform/usr/lib/python3.8:/snap/freeorion/386/gnome-platform/usr/lib/python3/dist-packages
So PYTHONPATH doesn't properly point to where the libs are in the snap even though they are in there. Not sure why I have so many gnome snaps. Is that the reason this is happening?

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#262 Post by Ophiuchus »

cengique wrote: Fri Sep 08, 2023 7:14 pm So PYTHONPATH doesn't properly point to where the libs are in the snap
hm. Not sure how python looks up the libs (those are in sub directories). I may have missed it but what are the results of 'which python3' and 'which python3.8' inside the snap respectively?

you could certainly try setting the python path yourself. If that works, the question is rather why it works on my system (with python path /snap/freeorion/387/gnome-platform/usr/lib/python3.8:/snap/freeorion/387/gnome-platform/usr/lib/python3/dist-packages) but not on yours.
I found an old post to what is supposed to happen gnome-3-34-extension-and-python-segfault/19650/10 (and it also hints at why the python from the coreXX is not used).

I do not think a different kernel would influence this. Maybe try a different snap which is also reliant on python. Or you could ask on the forum.snapcraft.io about the python/python path issue.

also for debugging lets stick to debian - i do not have a manjaro system at hand.
So PYTHONPATH doesn't properly point to where the libs are in the snap even though they are in there. Not sure why I have so many gnome snaps. Is that the reason this is happening?
No. You have three cores (coreXX) and three matching gnomes. This is completely normal. I guess the old one with core18 is used by skype.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#263 Post by cengique »

Ophiuchus wrote: Sat Sep 09, 2023 7:41 am hm. Not sure how python looks up the libs (those are in sub directories). I may have missed it but what are the results of 'which python3' and 'which python3.8' inside the snap respectively?
This is on Manjaro:

Code: Select all

$ snap run --shell freeorion
-$ which python3.8
/usr/bin/python3.8
-$ which python3
/usr/bin/python3
Looks like the configuration is identical to yours. Just confirm, freeoriond works for you, right? Why does freeorion work and not the daemon?

However, on the Debian system, I had to install the /beta version in parallel (because I'm currently hosting a game on it with /stable) and giving some problems:

Code: Select all

# snap install --channel=v0.5.0/beta freeorion_beta
freeorion_beta (v0.5.0/beta) v0.5-23-g8cf5e31e2 from A333 (agrrr3) installed
$ snap run --shell freeorion_beta
-$ which python 3
-$ which python 3.8
-$ echo $PYTHONPATH
/snap/freeorion/386/gnome-platform/usr/lib/python3.8:/snap/freeorion/386/gnome-platform/usr/lib/python3/dist-packages
-$ ls /snap/
ls: cannot open directory '/snap/': Permission denied
-$ whoami
bash: /usr/bin/whoami: Permission denied
Ophiuchus wrote: Sat Sep 09, 2023 7:41 am you could certainly try setting the python path yourself. If that works, the question is rather why it works on my system (with python path /snap/freeorion/387/gnome-platform/usr/lib/python3.8:/snap/freeorion/387/gnome-platform/usr/lib/python3/dist-packages) but not on yours.
I found an old post to what is supposed to happen gnome-3-34-extension-and-python-segfault/19650/10 (and it also hints at why the python from the coreXX is not used).
Ok, that's interesting and could explain the issue on Manjaro, but not on Debian.
Ophiuchus wrote: Sat Sep 09, 2023 7:41 am I do not think a different kernel would influence this. Maybe try a different snap which is also reliant on python. Or you could ask on the forum.snapcraft.io about the python/python path issue.
Ok, I may need to do this.

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#264 Post by cengique »

Also failing on another Gentoo system with snap version 2.58:

Code: Select all

$ sudo snap install --channel=v0.5.0/beta freeorion
freeorion (v0.5.0/beta) v0.5-23-g8cf5e31e2 from A333 (agrrr3) installed
$ freeorion.freeoriond
/snap/freeorion/386/usr/bin/freeoriond: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#265 Post by Ophiuchus »

cengique wrote: Sat Sep 09, 2023 3:41 pm Looks like the configuration is identical to yours. Just confirm, freeoriond works for you, right? Why does freeorion work and not the daemon?
both work for me
cengique wrote: Sat Sep 09, 2023 3:41 pm However, on the Debian system, I had to install the /beta version in parallel (because I'm currently hosting a game on it with /stable) and giving some problems:
i can check back next week on my debian system, but if i remember correctly i never ran there into problems with parallel installs
cengique wrote: Sat Sep 09, 2023 3:41 pm
Ophiuchus wrote: Sat Sep 09, 2023 7:41 am I found an old post to what is supposed to happen gnome-3-34-extension-and-python-segfault/19650/10 (and it also hints at why the python from the coreXX is not used).
Ok, that's interesting and could explain the issue on Manjaro, but not on Debian.
AFAIU the core snap is build ubuntu style and the gnome snap is build debian style (and that python is what the freeorion snap uses).
And it should not make a difference on between Manjaro and Debian host systems (as long as the sandbox works).
cengique wrote: Sat Sep 09, 2023 3:41 pm
Ophiuchus wrote: Sat Sep 09, 2023 7:41 am Or you could ask on the forum.snapcraft.io about the python/python path issue.
Ok, I may need to do this.
+1
cengique wrote: Sat Sep 09, 2023 7:59 pm Also failing on another Gentoo system with snap version 2.58:
thanks for the info. I see if I can get a manjaro or gentoo system somewhere (maybe from live-disk).
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#266 Post by cengique »

One more update; the run --shell environment is not the same as calling the snap binaries from outside on my Manjaro box. freeoriond finds the libraries when I'm inside the shell. So it seems like there's something wrong when it's run by snap.

I also figured out one can do this:

Code: Select all

snap run --strace freeorion.freeoriond
which shows where it's looking for the libraries.
snap-strace.log
(45.51 KiB) Downloaded 61 times
It's not even looking into the GNOME folders. It may simply be ignoring the value of PYTHONPATH.

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#267 Post by Ophiuchus »

cengique wrote: Sun Sep 10, 2023 7:57 pm One more update..
could you try the latest/edge latest/beta/graphics-core22 snap? it uses a different base etc. (NB on my fedora sound is not working)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#268 Post by Ophiuchus »

released new latest/beta, latest/beta/slow-game-025, latest/beta/graphics-core22

Code: Select all

latest   amd64   stable                v0.5                      352         -           -
                 candidate             ↑                         ↑           -           -
                 beta                  2023-09-11.92d35ef87      390         -           -
                 beta/slow-game-025    2023-09-11.92d35ef87      390         -           2023-10-13T00:00:00Z
                 beta/graphics-core22  2023-09-11.a288477e8      388         -           2023-10-13T00:00:00Z
         i386    stable                v0.4.10.1                 216         -           -
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

cengique
Krill Swarm
Posts: 12
Joined: Fri May 19, 2023 9:55 pm

Re: Up-to-date Test Snap

#269 Post by cengique »

Ophiuchus wrote: Mon Sep 11, 2023 10:24 pm could you try the latest/edge latest/beta/graphics-core22 snap? it uses a different base etc. (NB on my fedora sound is not working)
It works! No more library errors with freeoriond. I tested on my Manjaro and Debian boxes. Also, sound is working on Manjaro (didn't get to test on Debian).

Thanks :)

Ophiuchus
Programmer
Posts: 3495
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Up-to-date Test Snap

#270 Post by Ophiuchus »

weekly test build++ (d59b36a0c919d7efd06e4bfeff5e72144e6ffd39 plus mesa-core22 / nvidia-core22 support and minus the gnome dependency)

i smoketested single player game on a fedora system, with wayland and with x11. (wayland produces a million of sdl key press errors)
sound and everything seems to work
versions see below
cengique wrote: Sat Sep 16, 2023 12:32 am
Ophiuchus wrote: Mon Sep 11, 2023 10:24 pm could you try the latest/edge latest/beta/graphics-core22 snap? it uses a different base etc. (NB on my fedora sound is not working)
It works! No more library errors with freeoriond. I tested on my Manjaro and Debian boxes. Also, sound is working on Manjaro (didn't get to test on Debian).

Thanks :)
current freeorion latest/beta has another iteration; hope that works on manjaro

edge/slow-game-025 is the same as beta/slow-game-025 plus the first iteration of graphics-core22 support

Code: Select all

Track    Arch    Channel               Version                   Revision    Progress    Expires at
latest   amd64   stable                v0.5                      352         -           -
                 candidate             ↑                         ↑           -           -
                 beta                  2023-09-19.b600b17bb      401         -           -
                 edge/slow-game-025    2023-09-13.e702852fa      391         -           2023-10-14T00:00:00Z
                 beta/slow-game-025    2023-09-11.92d35ef87      390         -           2023-10-13T00:00:00Z
         i386    stable                v0.4.10.1                 216         -           -
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply