Hello, I am attempting to upgrade this snap from core22 to core24 (see WIP branch), but I’m getting this error when testing the main command within the snap in my GitHub Actions workflow after successfully building the snap image:
sudo snap install --devmode --dangerous ronin_2.0.5_amd64.snap
ronin --help
/snap/ronin/x1/usr/bin/ruby: error while loading shared libraries: libruby-3.2.so.3.2: cannot open shared object file: No such file or directory
This is likely due to the fact that I had to override LD_LIBRARY_PATH in order to force the ruby, git, and man packages to look for their shared library files within the snap image. After testing the ubuntu:24.04 docker image just to determine where ruby-3.2.so.3.2 was installed and adding ${SNAP}/lib/${SNAP_ARCH_TRIPLET} to LD_LIBRARY_PATH the error still persists.
The reason for upgrading from core22 to core24 is to gain access to a version of ruby >= 3.1.0, so that I can build snap images for my upcoming 2.1.0 release which requires ruby >= 3.1.0; and core22 only provides ruby version 3.0.x.
Yes it fixes that. Instead of overriding HOME, just change the source-code to get the path from the SNAP_REAL_HOME variable incase of snap. Because of mainly this issue.
Unfortunately, I cannot change the source code since there are too many instances where it uses HOME, plus the source code is ruby itself, rubygems, and the other ruby gems I install via https://rubygems.org/ into the snap image. Overriding HOME to use SNAP_REAL_HOME is a more pragmatic solution.
Also, I’m curious why setting HOME to SNAP_REAL_HOME would cause ruby to not find /lib/x86_64-linux-gnu/libruby-3.2.so.3.2? Those two things seem unrelated.