probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 411 forks source link

I try to use linuxdeployqt-6-x86_64.AppImage . But it produces very badly output (in true results are insane). #429

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello!

I try to use linuxdeployqt-6-x86_64.AppImage . But it produces very badly output (in true results are insane).

I try following commands:

$ time lddtree ./bin/perfekcyjna-kopia-konfigurator perfekcyjna-kopia-konfigurator => ./bin/perfekcyjna-kopia-konfigurator (interpreter => /lib64/ld-linux-x86-64.so.2) libQt5Widgets.so.5 => ./bin/../lib/libQt5Widgets.so.5 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 libakcesoria-programisty.so.1 => ./bin/../lib/libakcesoria-programisty.so.1 libSMTPEmail.so.1 => ./bin/../lib/libSMTPEmail.so.1 libQt5Network.so.5 => ./bin/../lib/libQt5Network.so.5 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 libQt5Gui.so.5 => ./bin/../lib/libQt5Gui.so.5 libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 libpng16.so.16 => ./bin/../lib/libpng16.so.16 libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 libQt5Core.so.5 => ./bin/../lib/libQt5Core.so.5 libicui18n.so.63 => ./bin/../lib/libicui18n.so.63 libicuuc.so.63 => ./bin/../lib/libicuuc.so.63 libicudata.so.63 => ./bin/../lib/libicudata.so.63 libpcre2-16.so.0 => ./bin/../lib/libpcre2-16.so.0 libdouble-conversion.so.3 => ./bin/../lib/libdouble-conversion.so.3 libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6

real 0m0,219s user 0m0,221s sys 0m0,064s

Which mean:

$ lddtree ./bin/perfekcyjna-kopia-konfigurator|wc -l 34

$ time linuxdeployqt-6-x86_64.AppImage ./bin/perfekcyjna-kopia-konfigurator -unsupported-allow-new-glibc -qmake=/usr/bin/qmake -always-overwrite -bundle-non-qt-libs linuxdeployqt 5 (commit 37631e5), build 631 built on 2019-01-25 22:47:58 UTC WARNING: Not checking glibc on the host system. The resulting AppDir or AppImage may not run on older systems. This mode is unsupported and discouraged. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340 FHS-like mode with PREFIX, fhsPrefix: "/home/energokoder/!-EnergoKod/instalator-perfekcyjna-kopia" app-binary: "/home/energokoder/!-EnergoKod/instalator-perfekcyjna-kopia/bin/perfekcyjna-kopia-konfigurator" appDirPath: "/home/energokoder/!-EnergoKod" relativeBinPath: "instalator-perfekcyjna-kopia/bin/perfekcyjna-kopia-konfigurator" Keeping existing AppRun

real 2m14,335s user 1m45,519s sys 0m30,012s

$ ls -1 ./lib libakcesoria-programisty.so.1 libbsd.so.0 libbz2.so.1.0 libdbus-1.so.3 libdouble-conversion.so.3 libgcrypt.so.20 libGLdispatch.so.0 libGLX.so.0 libgraphite2.so.3 libHalf.so.23 libicudata.so.63 libicui18n.so.63 libicuuc.so.63 libIex-2_2.so.23 libIlmImf-2_2.so.23 libIlmThread-2_2.so.23 libjbig.so.0 libjpeg.so.8 libKF5Archive.so.5 liblcms2.so.2 liblz4.so.1 liblzma.so.5 libmng.so.2 libpcre2-16.so.0 libpcre.so.3 libpng16.so.16 libQt5Core.so.5 libQt5DBus.so.5 libQt5Gui.so.5 libQt5Network.so.5 libQt5PrintSupport.so.5 libQt5Qml.so.5 libQt5Quick.so.5 libQt5VirtualKeyboard.so.5 libQt5Widgets.so.5 libQt5XcbQpa.so.5 libSMTPEmail.debug.so.1 libSMTPEmail.so.1 libsystemd.so.0 libtiff.so.5 libwebpdemux.so.2 libwebp.so.6 libX11-xcb.so.1 libXau.so.6 libxcb-glx.so.0 libxcb-icccm.so.4 libxcb-image.so.0 libxcb-keysyms.so.1 libxcb-randr.so.0 libxcb-render.so.0 libxcb-render-util.so.0 libxcb-shape.so.0 libxcb-shm.so.0 libxcb-sync.so.1 libxcb-util.so.1 libxcb-xfixes.so.0 libxcb-xinerama.so.0 libxcb-xinput.so.0 libxcb-xkb.so.1 libXdmcp.so.6 libxkbcommon.so.0 libxkbcommon-x11.so.0 libXrender.so.1 libzstd.so.1

Which mean: $ ls -1 ./lib|wc -l 64

To sum up these results: linuxdeployqt-6-x86_64.AppImage works horribly slow when compare to lddtree. Even wrost: For some unknown reasons linuxdeployqt-6-x86_64.AppImage copy almost twice more shared libraries! I can ensure you that lddtree results are correct - I only use libraries which it listed. It copies even debug version of libSMTPEmail.debug.so.1 !!! I wonder: What exactly took so much time for linuxdeployqt-6-x86_64.AppImage? I use strace to answer this. I don't analyse it very deeply - just look at output on the screen. What I see is that it constantly open icu libs (and other). I suspect linuxdeployqt-6-x86_64.AppImage is sily as hell: it do not remember analysed shared libs and it analyse allover again the same libs for every library in the dependency tree.

I recommended do not invent the hell again - instead I recommended to use blast fast lddtree in order to find libraries to deploy. If you thing that working time of linuxdeployqt-6-x86_64.AppImage is not important - then you are wrong! In order to test my installer I need run linuxdeployqt-6-x86_64.AppImage many times, and for now it is useless time.

Finally: I want to ask you: Have you plan to fix linuxdeployqt-6-x86_64.AppImage in reasonable time? Eg. within 2-3 weeks?

Best regards! Energo Koder

probonopd commented 4 years ago

Hello Energo,

linuxdeployqt will find and deploy more libraries than ldd because it also considers, for example, Qt plugins. I am pretty sure that linuxdeployqt will not bundle libraries for no reason. Please send a download link to your work-in-progress-AppDir if you like it to be analyzed.

Kind regards.

ghost commented 4 years ago
  1. I do not use ldd above! I use lddtree! So my results are correct. BTW: ldd produces the same results as lddtree (at least in the case of my app).
  2. I do not mention about plugins. It seems to me that they are correctly copied (only for used qt modules).
  3. I do not send my app to you. Instead I paste here library part of my project file:
    
    # Used libraries
    find_package(Qt5Core REQUIRED)
    list(APPEND LIBS Qt5::Core)
    find_package(Qt5Gui REQUIRED)
    list(APPEND LIBS Qt5::Gui)
    find_package(Qt5Widgets REQUIRED)
    list(APPEND LIBS Qt5::Widgets)

find_package(akcesoria-programisty REQUIRED) list(APPEND LIBS akcesoria-programisty)

find_package(fmt REQUIRED) list(APPEND LIBS fmt::fmt) list(APPEND INCLUDE_DIRS ${fmt_INCLUDE_DIRS})


If you will read carrefully linuxdeployqt nonsense output then you will find that it output libraries not used by my: QML and even QScript, libQt5Quick.so.5, libQt5VirtualKeyboard.so.5 
Libraries such: libSMTPEmail.debug.so.1 libSMTPEmail.so.1 are exclusive to each other.
What is suspected: line from linuxdeployqt output:
appDirPath: "/home/energokoder/!-EnergoKod"
This is not my app dir! App dir is:
/home/energokoder/!-EnergoKod/instalator-perfekcyjna-kopia
When I try to run linuxdeploy qt for this project I was suprised, thaty linuxdeploy qt found some old program in /home/energokoder/!-EnergoKod and aruge that it can' find libraries for it. So: This is prof that linuxdeploy scan nonsense direcotry (in my case all my projects directories, because I store them in /home/energokoder/!-EnergoKod). So the output is also nonsense and in my case required delete old app binary from copletely unrelated project!
probonopd commented 4 years ago

I do not use ldd above! I use lddtree! So my results are correct. BTW: ldd produces the same results as lddtree (at least in the case of my app).

ldd and lddtree are expected to give the same results but they don't automatically resolve plugins, so linuxdeployqt will find more than those two.

How does your directory layout look like? If linuxdeployqt is finding stuff from other applications, then maybe it is not recognizing your AppDir correctly. Do you have this structure?

appdir/usr/bin/yourapp
appdir/usr/share/applications/yourapp.desktop

?