Sigil-Ebook / PageEdit

ePub XHTML Visual Editor
GNU General Public License v3.0
245 stars 28 forks source link

Do not overlink the binary. #4

Closed eli-schwartz closed 5 years ago

eli-schwartz commented 5 years ago

Currently, CMake is checking for and attempting to link to more components than necessary.

Qt5Svg and Qt5XmlPatterns are not part of qtbase, and when they are not separately installed, configuring fails. They aren't actually used at runtime, though.

eli-schwartz commented 5 years ago

Looks like the Windows build may somehow want this, because the self-extracting exe produced by AppVeyor (and extracted via wine) contains the relevant .dll's anyway (at least Svg). objdump doesn't specify that they are linked to, though...

What does Windows want this for?

eli-schwartz commented 5 years ago

Oh, XmlPatterns is not copied over, just Qt5Svg.dll

I'd be willing to bet quite heavily that this is due to imageformats/qsvg.dll (which naturally needs Qt5Svg available). So anywhere that the imageformats plugin is available, windeployqt will simply copy it over, along with its dependency (Qt5Svg), despite the application itself not needing it.

dougmassay commented 5 years ago

We'll have to come up with some sort of cross-platform compromise then; because I can assure you that whether or not Windows actually needs svg, it's been my experience that windeployqt tries to distribute it (even if I leave it out of cmake) and PageEdit barks about it being missing at runtime.

Qt5Svg gets pulled in because windeployqt tags the svg image plugin as necessary.

I'll definitely skinny it up if I can, but I just don't believe there's a one-size-fits-all solution here for all three platforms.

dougmassay commented 5 years ago

I defer entirely to windeployqt for what the application actually needs on Windows. I'm not chasing the dependencies down step by excruciating step.

eli-schwartz commented 5 years ago

The Appveyor artifact for this PR has packaged up the Svg plugin, though, so isn't that all you need? (I haven't extensively tested it, but running this artifact in wine on Linux does successfully open and read an xhtml file.)

My assumption is that windeployqt should be able to handle just fine, the job of deciding that even though your app does not use Qt5Svg, the plugin that is being deployed alongside the app does -- and therefore it will package Qt5Svg too.

Presumably if the Qt5 that it was building against did not have qtsvg installed, it would not try to package the plugin, and therefore would not complain.

Am I misunderstanding something?

eli-schwartz commented 5 years ago

Also: the latest artifact from https://ci.appveyor.com/project/Sigil-Ebook/pageedit/builds/25567740/artifacts on master, does not deploy Qt5XmlPatterns anyway.

dougmassay commented 5 years ago

I have no idea. I've never built Sigil on Windows against a Qt5 package that didn't have QtSvg installed. You can't install the precompiled Windows Qt5 without QtSvg, and I've never bothered to NOT build QtSvg when custom compiling Qt5.

dougmassay commented 5 years ago

Also: the latest artifact from https://ci.appveyor.com/project/Sigil-Ebook/pageedit/builds/25567740/artifacts on master, does not deploy Qt5XmlPatterns anyway.

QtXmlPatterns is likely a holdout from Sigil pre-0.9.15. The annulen WebKit on Windows made it a requirement. Now that we've moved to WebEngine, it should be able to be safely removed.

dougmassay commented 5 years ago

@kevinhendricks : can you confirm that QtSvg and QtXmlPatterns are not needed for building/linking on MacOS (and/or will be included with the Mac dmg if macdeployqt deems a plugin needs them)? If they're not I'm inclined to accept this PR as is. If Windows should prove finicky for some reason, I can tweak it. But it should be fine.

kevinhendricks commented 5 years ago

On Mac, macdeployqt requires QtSvg and QXml, and QtXmlPatterns.

On Jun 26, 2019, at 7:18 PM, Doug Massay notifications@github.com wrote:

@kevinhendricks : can you confirm that QtSvg and QtXmlPatterns are not needed for building/linking on MacOS (and/or will be included with the Mac dmg if macdeployqt deems a plugin needs them)? If they're not I'm inclined to accept this PR as is. If Windows should prove finicky for some reason, I can tweak it. But it should be fine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kevinhendricks commented 5 years ago

Both are also directly linked to Sigil executable on macOS and I was required to sign both as part of the deep signing process.

On Jun 26, 2019, at 7:18 PM, Doug Massay notifications@github.com wrote:

@kevinhendricks : can you confirm that QtSvg and QtXmlPatterns are not needed for building/linking on MacOS (and/or will be included with the Mac dmg if macdeployqt deems a plugin needs them)? If they're not I'm inclined to accept this PR as is. If Windows should prove finicky for some reason, I can tweak it. But it should be fine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kevinhendricks commented 5 years ago

And they are both needed for PageEdit as well.

I will post a full list to this issue.

Kevin

On Jun 26, 2019, at 7:18 PM, Doug Massay notifications@github.com wrote:

@kevinhendricks : can you confirm that QtSvg and QtXmlPatterns are not needed for building/linking on MacOS (and/or will be included with the Mac dmg if macdeployqt deems a plugin needs them)? If they're not I'm inclined to accept this PR as is. If Windows should prove finicky for some reason, I can tweak it. But it should be fine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

dougmassay commented 5 years ago

On Mac, macdeployqt requires QtSvg and QtXml, and QtXmlPatterns.

Yes, but are QtSvg and QtXmlPatterns need for compiling/linking Sigil in the two locations specified in CMakeLists.txt file? I've found that with Windows that they're not. And that windeployqt knows to include them if they're required by any plugins that it deems are necessary -- even if they're not specified in the find_package and target_link_libraries sections of the CMakeLists.txt file.

dougmassay commented 5 years ago

If you say they are, though. Then they are. And this pull request would break MacOS builds without some tweaking.

kevinhendricks commented 5 years ago

mac_dependencies.txt

kevinhendricks commented 5 years ago

Okay, you can check out the actual dependencies for PageEdit on the mac. See mac_dependencies.txt That means the loader will fail is any of these are not in pace (and gatekeeper will whine if any of these are not signed).

Do not forget to check the dependencies of QtWebEngineProcess as it is an embedded executable as well.

The QtSvg is required for the svgicon plugins too. Just check the lists. The XML may be needed for translations and settings files and ui file processing routines too.

Feel free to do whatver you want but please do not break the mac build.

kevinhendricks commented 5 years ago

Please check the otool -L generated list of dependencies for PageEdit.

I can search the symbol tables for U symbols if need be to confirm things.

On Jun 26, 2019, at 7:41 PM, Doug Massay notifications@github.com wrote:

If you say they are, though. Then they are. And this pull request would break MacOS builds without some tweaking.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kevinhendricks commented 5 years ago

Okay, I used nm to look for any unresolved symbols and where those symbols were located all through the PageEdit executable. Then I did the same for each Qt framework. And based on that analysis, neither QtSvg or QXmlPatterns is directly used. They must come only from the plugins. Perhaps the qcocoastyle, and icon plugins.

So even though otool -L is showing a dependency, I can not actually find an unresolved symbol in the main executable that proves it.

So please go ahead and try removing those packages from the link for the main executable if you think we are overlinking. If so, we can always just fix it.

Kevin

On Jun 26, 2019, at 7:41 PM, Doug Massay notifications@github.com wrote:

If you say they are, though. Then they are. And this pull request would break MacOS builds without some tweaking.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

eli-schwartz commented 5 years ago

@kevinhendricks The find_packages is not actually used by deployqt at all, though. deployqt should only look at the executable which it is deploying.

All it is doing is generating instructions for cc (gcc/clang) and ld to compile and link the executable. The win/mac deployment program just looks at the compiled binary and copies over the libraries it thinks it needs, which are either present in the build environment or they aren't.

PageEdit's direct requirements may additionally pull in additional libraries (Webkit -> XmlPatterns?) but I assume that *deployqt handles that on its own -- and you don't need those in find_package because the transitive dependencies should be transitively pulled in by the direct dependencies which transitively need them.

AFAICT the only thing find_packages does at all is generate error messages during configure, in the event that your build environment does not even come with the component at all. :)

eli-schwartz commented 5 years ago

It's possible that target_link_libraries would, by causing overlinking, make the program link to a library which deployqt then bundles up as well, but if this is explicitly something needed in order to trick deployqt into shipping libraries which are required for a plugin but not being detected, then it would be good to know if that is the reason.

If not, then it would be good to not require it. ;)

Since I don't have a Windows or macOS development environment, and AppVeyor only does Windows builds that I can download and peek at, it would be good if you could test the PR on macOS and see what macdeployqt tries to bundle (and, if macOS is not using -Wl,--as-needed, then if the program still runs without linking to or bundling these libs.). ;)

dougmassay commented 5 years ago

I fear we're talking at cross-purposes just a bit.

There's what's required to build Sigil, and then there's what's required to deploy Sigil. Your (@kevinhendricks ) dependency list shows that there's a difference. On MacOS (and Windows, too), you show dependencies like QtQuick and QtQml and QtPositioning, etc... And Sigil will rightfully bark about it if any of them are missing at run time. But you'll also notice that we don't require cmake to find those particular modules (in find_package) when configuring the build. And we don't explicitly link to those extra modules in target_link_libraries.

Yet (mac|win)deployqt seems to be smart enough to include those extra necessary modules for a successful Sigil runtime environment (usually because the qt plugins included make those extra modules necessary).

So I'm I talking about removing QtXmlPatterns and QtSvg from the find_package and target_link_libraries calls in cmake, and seeing if Sigil still successfully builds, and if macdeployqt still includes them in the created dmg if some included plugin needs them. If so, nothing will change in your deployment and signing process. That's certainly what happened with windeployqt anyway.

The problem here is that Qt5Svg and Qt5XmlPatterns are extra packages on Linux systems. And adding them to the cmake find/link requirements means that packages will be installed that aren't actually needed to build and run Sigil on that platform.

kevinhendricks commented 5 years ago

Understood. Go ahead and pull it in and I will test things on macOS.

macdeployqt runs otool to get its runtime dependencies and it separately handles the plugins so we should be okay.

dougmassay commented 5 years ago

Will do. Please let me know if it does happen to break anything on the Mac as soon as you find out.

eli-schwartz commented 5 years ago

BTW as a matter of curiosity, is the otool command similar to Linux's ldd, which will list every library a program links to, and also list (recursively) every library that is linked to by a library the program actually uses? Or is it similar to Linux's readelf, which will show the program headers and list the libraries which your program directly needs?

The former is often a source of great confusion to Linux users who think that some program has an issue, for example, their openssl library is missing or broken and program_a won't run, but program_a doesn't use openssl -- it does use curl, and curl is configured to use openssl, and the thing which is actually broken is curl (not program_a).

On Linux, I usually tell people to use lddtree instead, a nifty tool that looks like this:

Tree-like output of lddtree ``` $ lddtree /usr/bin/pageedit pageedit => /usr/bin/pageedit (interpreter => /lib64/ld-linux-x86-64.so.2) libQt5WebEngineWidgets.so.5 => /usr/lib/libQt5WebEngineWidgets.so.5 libQt5WebEngineCore.so.5 => /usr/lib/libQt5WebEngineCore.so.5 libQt5WebChannel.so.5 => /usr/lib/libQt5WebChannel.so.5 libQt5Qml.so.5 => /usr/lib/libQt5Qml.so.5 libQt5Positioning.so.5 => /usr/lib/libQt5Positioning.so.5 libpthread.so.0 => /usr/lib/libpthread.so.0 libdl.so.2 => /usr/lib/libdl.so.2 librt.so.1 => /usr/lib/librt.so.1 libicui18n.so.64 => /usr/lib/libicui18n.so.64 libicuuc.so.64 => /usr/lib/libicuuc.so.64 libicudata.so.64 => /usr/lib/libicudata.so.64 libnss3.so => /usr/lib/libnss3.so libplds4.so => /usr/lib/libplds4.so libplc4.so => /usr/lib/libplc4.so libnssutil3.so => /usr/lib/libnssutil3.so libnspr4.so => /usr/lib/libnspr4.so libevent-2.1.so.6 => /usr/lib/libevent-2.1.so.6 libz.so.1 => /usr/lib/libz.so.1 libjpeg.so.8 => /usr/lib/libjpeg.so.8 libre2.so.0 => /usr/lib/libre2.so.0 libXss.so.1 => /usr/lib/libXss.so.1 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 libuuid.so.1 => /usr/lib/libuuid.so.1 libpng16.so.16 => /usr/lib/libpng16.so.16 libwebpmux.so.3 => /usr/lib/libwebpmux.so.3 libwebpdemux.so.2 => /usr/lib/libwebpdemux.so.2 libwebp.so.7 => /usr/lib/libwebp.so.7 libfreetype.so.6 => /usr/lib/libfreetype.so.6 libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 libexpat.so.1 => /usr/lib/libexpat.so.1 libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 libpcre.so.1 => /usr/lib/libpcre.so.1 libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 libX11.so.6 => /usr/lib/libX11.so.6 libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 libxcb.so.1 => /usr/lib/libxcb.so.1 libXau.so.6 => /usr/lib/libXau.so.6 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 libXcursor.so.1 => /usr/lib/libXcursor.so.1 libXfixes.so.3 => /usr/lib/libXfixes.so.3 libXext.so.6 => /usr/lib/libXext.so.6 libXi.so.6 => /usr/lib/libXi.so.6 libXrender.so.1 => /usr/lib/libXrender.so.1 libasound.so.2 => /usr/lib/libasound.so.2 libavcodec.so.58 => /usr/lib/libavcodec.so.58 libswresample.so.3 => /usr/lib/libswresample.so.3 libsoxr.so.0 => /usr/lib/libsoxr.so.0 libgomp.so.1 => /usr/lib/libgomp.so.1 liblzma.so.5 => /usr/lib/liblzma.so.5 libopencore-amrwb.so.0 => /usr/lib/libopencore-amrwb.so.0 libaom.so.0 => /usr/lib/libaom.so.0 libgsm.so.1 => /usr/lib/libgsm.so.1 libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 libopencore-amrnb.so.0 => /usr/lib/libopencore-amrnb.so.0 libopenjp2.so.7 => /usr/lib/libopenjp2.so.7 libspeex.so.1 => /usr/lib/libspeex.so.1 libtheoraenc.so.1 => /usr/lib/libtheoraenc.so.1 libogg.so.0 => /usr/lib/libogg.so.0 libtheoradec.so.1 => /usr/lib/libtheoradec.so.1 libvorbis.so.0 => /usr/lib/libvorbis.so.0 libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 libx264.so.157 => /usr/lib/libx264.so.157 libx265.so.169 => /usr/lib/libx265.so.169 libmvec.so.1 => /usr/lib/libmvec.so.1 libxvidcore.so.4 => /usr/lib/libxvidcore.so.4 libva.so.2 => /usr/lib/libva.so.2 libavformat.so.58 => /usr/lib/libavformat.so.58 libmodplug.so.1 => /usr/lib/libmodplug.so.1 libbluray.so.2 => /usr/lib/libbluray.so.2 libgmp.so.10 => /usr/lib/libgmp.so.10 libgnutls.so.30 => /usr/lib/libgnutls.so.30 libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 libffi.so.6 => /usr/lib/libffi.so.6 libidn2.so.0 => /usr/lib/libidn2.so.0 libunistring.so.2 => /usr/lib/libunistring.so.2 libtasn1.so.6 => /usr/lib/libtasn1.so.6 libnettle.so.6 => /usr/lib/libnettle.so.6 libhogweed.so.4 => /usr/lib/libhogweed.so.4 libssh.so.4 => /usr/lib/libssh.so.4 libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 libavutil.so.56 => /usr/lib/libavutil.so.56 libva-drm.so.2 => /usr/lib/libva-drm.so.2 libva-x11.so.2 => /usr/lib/libva-x11.so.2 libvdpau.so.1 => /usr/lib/libvdpau.so.1 libdrm.so.2 => /usr/lib/libdrm.so.2 libvpx.so.6 => /usr/lib/libvpx.so.6 libsnappy.so.1 => /usr/lib/libsnappy.so.1 libopus.so.0 => /usr/lib/libopus.so.0 libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 libsystemd.so.0 => /usr/lib/libsystemd.so.0 liblz4.so.1 => /usr/lib/liblz4.so.1 libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 libxml2.so.2 => /usr/lib/libxml2.so.2 libxslt.so.1 => /usr/lib/libxslt.so.1 libminizip.so.1 => /usr/lib/libminizip.so.1 liblcms2.so.2 => /usr/lib/liblcms2.so.2 libm.so.6 => /usr/lib/libm.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libQt5Quick.so.5 => /usr/lib/libQt5Quick.so.5 libQt5PrintSupport.so.5 => /usr/lib/libQt5PrintSupport.so.5 libQt5Network.so.5 => /usr/lib/libQt5Network.so.5 libssl.so.1.1 => /usr/lib/libssl.so.1.1 libQt5QuickWidgets.so.5 => /usr/lib/libQt5QuickWidgets.so.5 libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 libGL.so.1 => /usr/lib/libGL.so.1 libGLX.so.0 => /usr/lib/libGLX.so.0 libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 libzstd.so.1 => /usr/lib/libzstd.so.1 libstdc++.so.6 => /usr/lib/libstdc++.so.6 libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 libc.so.6 => /usr/lib/libc.so.6 ```

With this sort of output, I would immediately know that a user who complained about errors with libdouble-conversion.so should not be blaming PageEdit. :D

The highly confusing output of plain old ldd ``` $ ldd /usr/bin/pageedit linux-vdso.so.1 (0x00007ffc5836b000) libQt5WebEngineWidgets.so.5 => /usr/lib/libQt5WebEngineWidgets.so.5 (0x00007fb6c33f5000) libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x00007fb6c2d5e000) libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x00007fb6c277c000) libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007fb6c2272000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fb6c208a000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fb6c2070000) libc.so.6 => /usr/lib/libc.so.6 (0x00007fb6c1ea9000) libQt5WebEngineCore.so.5 => /usr/lib/libQt5WebEngineCore.so.5 (0x00007fb6ba40e000) libQt5Quick.so.5 => /usr/lib/libQt5Quick.so.5 (0x00007fb6b9f41000) libQt5PrintSupport.so.5 => /usr/lib/libQt5PrintSupport.so.5 (0x00007fb6b9ecc000) libQt5Network.so.5 => /usr/lib/libQt5Network.so.5 (0x00007fb6b9d11000) libQt5QuickWidgets.so.5 => /usr/lib/libQt5QuickWidgets.so.5 (0x00007fb6b9cfb000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fb6b9cd8000) libm.so.6 => /usr/lib/libm.so.6 (0x00007fb6b9b92000) libGL.so.1 => /usr/lib/libGL.so.1 (0x00007fb6b9aff000) libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fb6b9ac7000) libz.so.1 => /usr/lib/libz.so.1 (0x00007fb6b98b0000) libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007fb6b97c2000) libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007fb6b9719000) libicui18n.so.64 => /usr/lib/libicui18n.so.64 (0x00007fb6b9424000) libicuuc.so.64 => /usr/lib/libicuuc.so.64 (0x00007fb6b924c000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fb6b9247000) libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007fb6b91c6000) libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 (0x00007fb6b91af000) libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007fb6b910d000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007fb6b8fe7000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fb6c3593000) libQt5WebChannel.so.5 => /usr/lib/libQt5WebChannel.so.5 (0x00007fb6b8fc6000) libQt5Positioning.so.5 => /usr/lib/libQt5Positioning.so.5 (0x00007fb6b8f30000) librt.so.1 => /usr/lib/librt.so.1 (0x00007fb6b8f25000) libnss3.so => /usr/lib/libnss3.so (0x00007fb6b8df4000) libnssutil3.so => /usr/lib/libnssutil3.so (0x00007fb6b8dbf000) libnspr4.so => /usr/lib/libnspr4.so (0x00007fb6b8d7d000) libevent-2.1.so.6 => /usr/lib/libevent-2.1.so.6 (0x00007fb6b8d25000) libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007fb6b8c90000) libre2.so.0 => /usr/lib/libre2.so.0 (0x00007fb6b8c26000) libXss.so.1 => /usr/lib/libXss.so.1 (0x00007fb6b8c21000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007fb6b8bd8000) libwebpmux.so.3 => /usr/lib/libwebpmux.so.3 (0x00007fb6b8bcc000) libwebpdemux.so.2 => /usr/lib/libwebpdemux.so.2 (0x00007fb6b8bc6000) libwebp.so.7 => /usr/lib/libwebp.so.7 (0x00007fb6b8b56000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fb6b8a87000) libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007fb6b8a5a000) libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fb6b8919000) libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x00007fb6b8914000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fb6b88ea000) libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007fb6b88de000) libXext.so.6 => /usr/lib/libXext.so.6 (0x00007fb6b88c9000) libXi.so.6 => /usr/lib/libXi.so.6 (0x00007fb6b88b6000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007fb6b88a7000) libasound.so.2 => /usr/lib/libasound.so.2 (0x00007fb6b87c4000) libavcodec.so.58 => /usr/lib/libavcodec.so.58 (0x00007fb6b72b6000) libavformat.so.58 => /usr/lib/libavformat.so.58 (0x00007fb6b7061000) libavutil.so.56 => /usr/lib/libavutil.so.56 (0x00007fb6b6fe4000) libvpx.so.6 => /usr/lib/libvpx.so.6 (0x00007fb6b6c89000) libsnappy.so.1 => /usr/lib/libsnappy.so.1 (0x00007fb6b6a7f000) libopus.so.0 => /usr/lib/libopus.so.0 (0x00007fb6b6a21000) libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fb6b69d7000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fb6b686f000) libxslt.so.1 => /usr/lib/libxslt.so.1 (0x00007fb6b682e000) libminizip.so.1 => /usr/lib/libminizip.so.1 (0x00007fb6b6623000) liblcms2.so.2 => /usr/lib/liblcms2.so.2 (0x00007fb6b63c6000) libQt5Qml.so.5 => /usr/lib/libQt5Qml.so.5 (0x00007fb6b5eee000) libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007fb6b5e5e000) libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007fb6b5b8a000) libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007fb6b5b57000) libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007fb6b5a99000) libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007fb6b5a74000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007fb6b584e000) liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007fb6b582d000) libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007fb6b570e000) libicudata.so.64 => /usr/lib/libicudata.so.64 (0x00007fb6b3cca000) libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fb6b3c55000) libplds4.so => /usr/lib/libplds4.so (0x00007fb6b3c50000) libplc4.so => /usr/lib/libplc4.so (0x00007fb6b3c49000) libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007fb6b3c40000) libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007fb6b3c2d000) libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fb6b3c26000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fb6b3c1e000) libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007fb6b3a18000) libswresample.so.3 => /usr/lib/libswresample.so.3 (0x00007fb6b39f8000) libopencore-amrwb.so.0 => /usr/lib/libopencore-amrwb.so.0 (0x00007fb6b39e2000) libaom.so.0 => /usr/lib/libaom.so.0 (0x00007fb6b316d000) libgsm.so.1 => /usr/lib/libgsm.so.1 (0x00007fb6b2f61000) libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0x00007fb6b2ce8000) libopencore-amrnb.so.0 => /usr/lib/libopencore-amrnb.so.0 (0x00007fb6b2cbd000) libopenjp2.so.7 => /usr/lib/libopenjp2.so.7 (0x00007fb6b2c60000) libspeex.so.1 => /usr/lib/libspeex.so.1 (0x00007fb6b2c45000) libtheoraenc.so.1 => /usr/lib/libtheoraenc.so.1 (0x00007fb6b2a04000) libtheoradec.so.1 => /usr/lib/libtheoradec.so.1 (0x00007fb6b27ea000) libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007fb6b25be000) libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x00007fb6b2315000) libx264.so.157 => /usr/lib/libx264.so.157 (0x00007fb6b204a000) libx265.so.169 => /usr/lib/libx265.so.169 (0x00007fb6b0d05000) libxvidcore.so.4 => /usr/lib/libxvidcore.so.4 (0x00007fb6b09f2000) libva.so.2 => /usr/lib/libva.so.2 (0x00007fb6b09ce000) libmodplug.so.1 => /usr/lib/libmodplug.so.1 (0x00007fb6b0843000) libbluray.so.2 => /usr/lib/libbluray.so.2 (0x00007fb6b07f3000) libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007fb6b075f000) libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x00007fb6b05af000) libssh.so.4 => /usr/lib/libssh.so.4 (0x00007fb6b052f000) libva-drm.so.2 => /usr/lib/libva-drm.so.2 (0x00007fb6b052a000) libva-x11.so.2 => /usr/lib/libva-x11.so.2 (0x00007fb6b0522000) libvdpau.so.1 => /usr/lib/libvdpau.so.1 (0x00007fb6b051d000) libdrm.so.2 => /usr/lib/libdrm.so.2 (0x00007fb6b0509000) libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007fb6b04e4000) libsoxr.so.0 => /usr/lib/libsoxr.so.0 (0x00007fb6b0270000) libogg.so.0 => /usr/lib/libogg.so.0 (0x00007fb6b0069000) libmvec.so.1 => /usr/lib/libmvec.so.1 (0x00007fb6b003d000) libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x00007fb6aff0b000) libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007fb6afeec000) libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007fb6afb6c000) libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007fb6af959000) libnettle.so.6 => /usr/lib/libnettle.so.6 (0x00007fb6af91f000) libhogweed.so.4 => /usr/lib/libhogweed.so.4 (0x00007fb6af8e6000) libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007fb6af8ab000) libffi.so.6 => /usr/lib/libffi.so.6 (0x00007fb6af8a0000) ```
readelf makes it clear that at least on Linux, we could probably be more conservative ``` $ readelf -d /usr/bin/pageedit Dynamic section at offset 0x11fc30 contains 29 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libQt5WebEngineWidgets.so.5] 0x0000000000000001 (NEEDED) Shared library: [libQt5Widgets.so.5] 0x0000000000000001 (NEEDED) Shared library: [libQt5Gui.so.5] 0x0000000000000001 (NEEDED) Shared library: [libQt5Core.so.5] 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000c (INIT) 0x23000 0x000000000000000d (FINI) 0x91598 0x0000000000000019 (INIT_ARRAY) 0x11e190 0x000000000000001b (INIT_ARRAYSZ) 104 (bytes) 0x000000000000001a (FINI_ARRAY) 0x11e1f8 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x308 0x0000000000000005 (STRTAB) 0x9c58 0x0000000000000006 (SYMTAB) 0x1f60 0x000000000000000a (STRSZ) 49282 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000015 (DEBUG) 0x0 0x0000000000000007 (RELA) 0x168a8 0x0000000000000008 (RELASZ) 47304 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x0000000000000018 (BIND_NOW) 0x000000006ffffffb (FLAGS_1) Flags: NOW PIE 0x000000006ffffffe (VERNEED) 0x16748 0x000000006fffffff (VERNEEDNUM) 7 0x000000006ffffff0 (VERSYM) 0x15cda 0x000000006ffffff9 (RELACOUNT) 855 0x0000000000000000 (NULL) 0x0 ```
dougmassay commented 5 years ago

I use lddtree quite a bit myself. :)

Dependency Walker for Windows is similar (though it's a bit broken--but still quite handy--on Windows 10).

eli-schwartz commented 5 years ago

I force pushed with no changes in order to correct a commit message typo. webkit -> webengine.

dougmassay commented 5 years ago

Done. If there are no issues, I'm thinking Sigil itself might be in the same boat in this regard, no?

eli-schwartz commented 5 years ago

Yes, probably, and I'm testing it out right now. Sigil is sort of a bigger target, though, not least because I'm not sure exactly how the additional python_pkg gather stuff is supposed to work.

dougmassay commented 5 years ago

PyQt5 would probably the only thing affected by removing Qt libs. And I already only include a very small subset of the the matching python libraries anyway.

'Qt', 'QtCore', 'QtGui', 'QtNetwork', 'QtPrintSupport', 'QtSvg', 'QtWidgets' is the current list of supported/included PyQt5 modules needed for the Windows package. QtSvg is there, but windeployqt includes the corresponding QtSvg dll on Windows anyway.

Kevin's Mac python deployment pretty-much mirrors that, I think.