I was forced to update the version of the operating system to Ubuntu 20.04 on the build server. Using ‘base: core20’ in snapcraft.yaml
I have a problem with hardcoded paths in the library.
Unable to fork a new WebProcess: Failed to execute child process “/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitNetworkProcess” (No such file or directory)`
As I understand the developers, it is recommended to use snapcraft-preload in the snapcraft.yaml file
snapcraft-preload:
source: https://github.com/sergiusens/snapcraft-preload.git
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
build-packages:
- on amd64:
- gcc-multilib
- g++-multilib
Inside my run.sh startup script (adapted copy of desktop-launch) there are lines
append_dir LD_LIBRARY_PATH $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/
if [ -f $SNAP/usr/lib/libsnapcraft-preload.so ]; then
export LD_PRELOAD=$LD_PRELOAD:$SNAP/usr/lib/libsnapcraft-preload.so
fi
$SNAP/usr/bin/snapcraft-preload $SNAP/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java bla-bla-bla-java-jar
If you install the snap package and call the program for the first time
ERROR: ld.so: object ‘/snap/my-java-app/x1/lib/libsnapcraft-preload.so’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
** (my-java-app:142669): ERROR **: 16:24:59.347: Unable to fork a new child process: Failed to execute child process “/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitNetworkProcess” (No such file or directory)
Second launch and the program starts normally.
ERROR: ld.so: object ‘/snap/my-java-app/x1/lib/libsnapcraft-preload.so’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Help solve the problem correctly.