pencil icon indicating copy to clipboard operation
pencil copied to clipboard

Consider switching from linuxdeployqt to linuxdeploy

Open scribblemaniac opened this issue 4 years ago • 3 comments

In making the linux legacy release for the latest version of Pencil2D, I was reminded of some changes I made for the build process of the 0.6.5 linux legacy build. Most importantly, I stopped using linuxdeployqt because it was becoming increasingly difficult to get it working with 32-bit architectures. After looking at a couple alternatives I settled on linuxdeploy for that release, and I have used it again for the 0.6.6 release. Based on my experiences with it, I believe that we should consider migrating all of our linux deployments (64-bit releases, and nightlies) to linuxdeploy.

The main reason to migrate is that it it is very easy to call, and handles gstreamer plugins properly without the workarounds we currently have to employ for linuxdeployqt (although I have not tested this with the 64-bit version). The usage for linuxdeploy would look like this (after make install + ffmpeg install + dependency install):

linuxdeploy --appdir Pencil2D --plugin qt
appimagetool Pencil2D pencil2d-linux-arch-version.AppImage

For context, that would replace all of this in after-build.sh:

install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" \
    "Pencil2D/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
  local gst_executables="-executable=Pencil2D/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
  for plugin in adpcmdec alsa app audioconvert audioparsers audioresample \
      autodetect coreelements gsm id3demux jack mpg123 mulaw playback \
      pulse typefindfunctions wavparse apetag; do
    install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst${plugin}.so" \
      "Pencil2D/usr/lib/gstreamer-1.0/libgst${plugin}.so"
    gst_executables="${gst_executables} -executable=Pencil2D/usr/lib/gstreamer-1.0/libgst${plugin}.so"
  done
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/pulseaudio" \
    ./linuxdeployqt-continuous-x86_64.AppImage \
    Pencil2D/usr/share/applications/org.pencil2d.Pencil2D.desktop \
    -executable=Pencil2D/usr/plugins/ffmpeg \
    ${gst_executables} \
    -appimage

scribblemaniac avatar Feb 18 '21 09:02 scribblemaniac

Thanks for the suggestion. I gave linuxdeploy a try, but I’m still having some issues with it.

First, I tried running the 0.6.6 legacy build but I get the error “/tmp/.mount_pencilkD4QaC/AppRun.wrapped: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory” even though libssl.so.10 is in fact contained in the AppImage. To be fair, I’m using a 64bit system, but then again I’m not having any issues running the 0.6.4 legacy build, which was still made with linuxdeployqt as far as I understand.

But just in case I tried making some 64 bit AppImages, and voilá, it starts up fine. However, when I try to import any non-WAV audio files, I get a “File doesn’t exist” error dialog and “[ffmpeg] "/tmp/.mount_pencilbYASH8/usr/plugins/ffmpeg: error while loading shared libraries: libass.so.5: cannot open shared object file: No such file or directory"” on the terminal. I tried fixing that with the --executable option like we do with linuxdeployqt, but that only led to a sizable increase of the AppImage file size without actually fixing the problem.

Lastly, when I import a WAV file (which works fine) I get the problem where the sound clip doesn’t have the correct length and doesn’t play back, I assume it’s the same issue we had with linuxdeployqt. Whatever GStreamer support linuxdeploy has doesn’t seem to be working for me.

So I did what you usually do in these cases and ran ldd on the executables, which gave me this output:

ldd on ffmpeg (64 bit linuxdeploy AppImage)
	linux-vdso.so.1 (0x00007ffea6384000)
	libXv.so.1 => /usr/lib/libXv.so.1 (0x00007f5d834af000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f5d8336e000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f5d83359000)
	libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0x00007f5d831c4000)
	libpulse.so.0 => /usr/lib/libpulse.so.0 (0x00007f5d8316f000)
	libass.so.5 => not found
	libgnutls.so.26 => not found
	libvdpau.so.1 => /usr/lib/libvdpau.so.1 (0x00007f5d83168000)
	libva.so.1 => not found
	libva-x11.so.1 => not found
	libva-drm.so.1 => not found
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f5d8313e000)
	libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f5d83137000)
	libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x00007f5d8312d000)
	libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x00007f5d83128000)
	libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f5d83049000)
	libzimg.so.2 => not found
	libxvidcore.so.4 => /usr/lib/libxvidcore.so.4 (0x00007f5d82f3a000)
	libx265.so.130 => not found
	libx264.so.148 => not found
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5d82f17000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f5d82dd2000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5d82dcb000)
	libwavpack.so.1 => /usr/lib/libwavpack.so.1 (0x00007f5d82da0000)
	libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x00007f5d82cf3000)
	libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007f5d82cc5000)
	libvidstab.so.1.0 => not found
	libtheoraenc.so.1 => /usr/lib/libtheoraenc.so.1 (0x00007f5d82c8c000)
	libtheoradec.so.1 => /usr/lib/libtheoradec.so.1 (0x00007f5d82c73000)
	libspeex.so.1 => /usr/lib/libspeex.so.1 (0x00007f5d82c58000)
	libsoxr.so.0 => /usr/lib/libsoxr.so.0 (0x00007f5d82bd4000)
	libopus.so.0 => /usr/lib/libopus.so.0 (0x00007f5d82b76000)
	libopencore-amrwb.so.0 => /usr/lib/libopencore-amrwb.so.0 (0x00007f5d82b60000)
	libopencore-amrnb.so.0 => /usr/lib/libopencore-amrnb.so.0 (0x00007f5d82b34000)
	libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0x00007f5d82abc000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f5d829e8000)
	libfdk-aac.so.1 => not found
	libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f5d829d3000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007f5d829b9000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f5d827ec000)
	libpulsecommon-14.2.so => /usr/lib/pulseaudio/libpulsecommon-14.2.so (0x00007f5d82767000)
	libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f5d82710000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f5d8270b000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f5d82703000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007f5d826f8000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5d834ff000)
	libogg.so.0 => /usr/lib/libogg.so.0 (0x00007f5d826ed000)
	libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f5d826aa000)
	libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f5d82673000)
	libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f5d8259f000)
	libsndfile.so.1 => /usr/lib/libsndfile.so.1 (0x00007f5d8251d000)
	libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f5d82467000)
	libasyncns.so.0 => /usr/lib/libasyncns.so.0 (0x00007f5d8245d000)
	libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f5d82438000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f5d82303000)
	libFLAC.so.8 => /usr/lib/libFLAC.so.8 (0x00007f5d822c4000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f5d8229c000)
	libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f5d821bf000)
	liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f5d8219c000)
	libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f5d8206a000)
	libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f5d82050000)
	libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f5d81fde000)
	libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f5d81fb5000)
ldd on pencil2d (0.6.4 legacy AppImage)
	linux-gate.so.1 (0xf7f2d000)
	libQt5Svg.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Svg.so.5 (0xf7ecb000)
	libQt5Widgets.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Widgets.so.5 (0x075d2000)
	libQt5Multimedia.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Multimedia.so.5 (0xf7dcf000)
	libQt5Gui.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Gui.so.5 (0x064d6000)
	libQt5Xml.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Xml.so.5 (0xf7d8b000)
	libQt5Network.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Network.so.5 (0x05841000)
	libQt5Core.so.5 => /tmp/squashfs-root/usr/bin/../lib/libQt5Core.so.5 (0x05367000)
	libGL.so.1 => /usr/lib32/libGL.so.1 (0xf7cd9000)
	libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf7cb7000)
	libc++.so.1 => /tmp/squashfs-root/usr/bin/../lib/libc++.so.1 (0xf7be5000)
	libm.so.6 => /usr/lib32/libm.so.6 (0xf7b15000)
	libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7af7000)
	libc.so.6 => /usr/lib32/libc.so.6 (0xf78ff000)
	libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf772e000)
	libz.so.1 => /usr/lib32/libz.so.1 (0xf7714000)
	libgobject-2.0.so.0 => /usr/lib32/libgobject-2.0.so.0 (0xf76b6000)
	libgthread-2.0.so.0 => /usr/lib32/libgthread-2.0.so.0 (0xf76b1000)
	librt.so.1 => /usr/lib32/librt.so.1 (0xf76a6000)
	libglib-2.0.so.0 => /usr/lib32/libglib-2.0.so.0 (0xf755c000)
	libXext.so.6 => /usr/lib32/libXext.so.6 (0xf7546000)
	libX11.so.6 => /usr/lib32/libX11.so.6 (0xf73f7000)
	libpulse.so.0 => /tmp/squashfs-root/usr/bin/../lib/libpulse.so.0 (0x00d68000)
	libpng12.so.0 => /usr/lib32/libpng12.so.0 (0xf73c5000)
	libssl.so.10 => not found
	libcrypto.so.10 => not found
	libicui18n.so.42 => not found
	libicuuc.so.42 => not found
	libicudata.so.42 => not found
	libdl.so.2 => /usr/lib32/libdl.so.2 (0xf73bf000)
	/lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7f2f000)
	libGLdispatch.so.0 => /usr/lib32/libGLdispatch.so.0 (0xf7343000)
	libGLX.so.0 => /usr/lib32/libGLX.so.0 (0xf7306000)
	libffi.so.7 => /usr/lib32/libffi.so.7 (0xf72fb000)
	libpcre.so.1 => /usr/lib32/libpcre.so.1 (0xf7284000)
	libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf7258000)
	libpulsecommon-0.9.21.so => /tmp/squashfs-root/usr/bin/../lib/libpulsecommon-0.9.21.so (0x00ceb000)
	libICE.so.6 => /usr/lib32/libICE.so.6 (0xf723c000)
	libSM.so.6 => /usr/lib32/libSM.so.6 (0xf7230000)
	libXtst.so.6 => /tmp/squashfs-root/usr/bin/../lib/libXtst.so.6 (0x05ae7000)
	libwrap.so.0 => /tmp/squashfs-root/usr/bin/../lib/libwrap.so.0 (0xf7225000)
	libsndfile.so.1 => /tmp/squashfs-root/usr/bin/../lib/libsndfile.so.1 (0x00c74000)
	libasyncns.so.0 => /tmp/squashfs-root/usr/bin/../lib/libasyncns.so.0 (0x00ce3000)
	libdbus-1.so.3 => /tmp/squashfs-root/usr/bin/../lib/libdbus-1.so.3 (0x008c6000)
	libXau.so.6 => /usr/lib32/libXau.so.6 (0xf721e000)
	libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf7216000)
	libuuid.so.1 => /usr/lib32/libuuid.so.1 (0xf720c000)
	libXi.so.6 => /tmp/squashfs-root/usr/bin/../lib/libXi.so.6 (0x008ae000)
	libnsl.so.1 => /tmp/squashfs-root/usr/bin/../lib/libnsl.so.1 (0xf71f1000)
	libFLAC.so.8 => /tmp/squashfs-root/usr/bin/../lib/libFLAC.so.8 (0x05d78000)
	libvorbisenc.so.2 => /tmp/squashfs-root/usr/bin/../lib/libvorbisenc.so.2 (0x00b78000)
	libvorbis.so.0 => /tmp/squashfs-root/usr/bin/../lib/libvorbis.so.0 (0x05be4000)
	libogg.so.0 => /tmp/squashfs-root/usr/bin/../lib/libogg.so.0 (0x05aef000)
	libresolv.so.2 => /usr/lib32/libresolv.so.2 (0xf71d5000)

When we look at that output, we can see two different things:

  • In the case of the FFmpeg issue, the executable doesn’t seem to use the bundled libraries at all, which is likely because the rpath isn’t set properly or something. linuxdeployqt had this issue too back in the day and I had to fix it in order to get ffmpeg working, which wasn’t terribly difficult.
  • In the legacy build, the executable does pick up some of the libraries it uses from the AppImage, however others are not found at all (including even ICU, which has a notoriously unstable ABI AFAIK). As it turns out, those libraries are missing entirely in the AppImage. This is pretty weird, especially since the 64bit build I made does not have that issue

As long as linuxdeploy has those two issues as well as the GStreamer one, I’m against switching over. That said, linuxdeployqt hasn’t seen a single code change in more than a year, so I actually wouldn’t mind switching over to something more actively maintained; we just need to have those bugs ironed out. However, as long as linuxdeployqt still works, I’m not very motivated to work on that myself since I already have enough other things to worry about, so I’ll leave that to you scribble.

J5lx avatar Feb 18 '21 20:02 J5lx

I will look into these issues. None of the things mentioned were problems on the systems I built the appimage on, but clearly some dependencies aren't being properly included. I'm not really concerned about compatibility with 64-bit systems, however the 0.6.6 version does not work on my other 32-bit images, unlike the 0.6.5 which worked fine I believe.

scribblemaniac avatar Feb 22 '21 00:02 scribblemaniac