build: skip deploying plugins we dont use in macdeployqtplus #16477

pull fanquake wants to merge 4 commits into bitcoin:master from fanquake:slim_macdeployqtplus changing 1 files +94 −52
  1. fanquake commented at 3:12 AM on July 28, 2019: member

    I frequently run make deploy while testing on macOS to get a properly light themed .app. With a brew installed Qt, this currently results in a pretty bloated executable:

    branch .app size .dmg size make deploy time
    master (febf3a856bcfb8fef2cb4ddcb8d1e0cab8a22580) 235mb 86mb 38s
    This PR (da98f6d470d236c027b7eb8b5f5552fdca04e803) 51mb 21mb 22s

    Similar change to dd367ff8c93c2f9e112a324f5cd737c7fa7a2ffa.

                             'QtGui.framework'],
      'pluginPath': '/usr/local/opt/qt/plugins',
      'qtPath': '/usr/local/opt/qt'}
    -[('platforminputcontexts', 'libqtvirtualkeyboardplugin.dylib'),
    - ('geoservices', 'libqtgeoservices_esri.dylib'),
    - ('geoservices', 'libqtgeoservices_mapboxgl.dylib'),
    - ('geoservices', 'libqtgeoservices_nokia.dylib'),
    - ('geoservices', 'libqtgeoservices_itemsoverlay.dylib'),
    - ('geoservices', 'libqtgeoservices_osm.dylib'),
    - ('geoservices', 'libqtgeoservices_mapbox.dylib'),
    - ('sceneparsers', 'libgltfsceneexport.dylib'),
    - ('sceneparsers', 'libgltfsceneimport.dylib'),
    - ('platforms', 'libqwebgl.dylib'),
    +[('platforms', 'libqwebgl.dylib'),
      ('platforms', 'libqoffscreen.dylib'),
      ('platforms', 'libqminimal.dylib'),
      ('platforms', 'libqcocoa.dylib'),
      ('platformthemes', 'libqxdgdesktopportal.dylib'),
    - ('printsupport', 'libcocoaprintersupport.dylib'),
    - ('webview', 'libqtwebview_webengine.dylib'),
    - ('webview', 'libqtwebview_darwin.dylib'),
    - ('geometryloaders', 'libdefaultgeometryloader.dylib'),
    - ('geometryloaders', 'libgltfgeometryloader.dylib'),
      ('styles', 'libqmacstyle.dylib'),
    - ('canbus', 'libqttinycanbus.dylib'),
    - ('canbus', 'libqtpassthrucanbus.dylib'),
    - ('canbus', 'libqtvirtualcanbus.dylib'),
    - ('canbus', 'libqtpeakcanbus.dylib'),
      ('bearer', 'libqgenericbearer.dylib'),
    - ('imageformats', 'libqgif.dylib'),
    - ('imageformats', 'libqwbmp.dylib'),
    - ('imageformats', 'libqwebp.dylib'),
    - ('imageformats', 'libqico.dylib'),
    - ('imageformats', 'libqmacheif.dylib'),
    - ('imageformats', 'libqjpeg.dylib'),
    - ('imageformats', 'libqtiff.dylib'),
    - ('imageformats', 'libqicns.dylib'),
    - ('imageformats', 'libqtga.dylib'),
    - ('imageformats', 'libqmacjp2.dylib'),
    - ('texttospeech', 'libqtexttospeech_speechosx.dylib'),
    - ('generic', 'libqtuiotouchplugin.dylib'),
    - ('renderplugins', 'libscene2d.dylib'),
    - ('gamepads', 'libdarwingamepad.dylib'),
    - ('virtualkeyboard', 'libqtvirtualkeyboard_thai.dylib'),
    - ('virtualkeyboard', 'libqtvirtualkeyboard_openwnn.dylib'),
    - ('virtualkeyboard', 'libqtvirtualkeyboard_hangul.dylib'),
    - ('virtualkeyboard', 'libqtvirtualkeyboard_pinyin.dylib'),
    - ('virtualkeyboard', 'libqtvirtualkeyboard_tcime.dylib')]
    + ('generic', 'libqtuiotouchplugin.dylib')]
    
  2. fanquake added the label Build system on Jul 28, 2019
  3. fanquake added the label Needs gitian build on Jul 28, 2019
  4. fanquake requested review from theuni on Jul 28, 2019
  5. promag commented at 1:09 PM on July 28, 2019: member

    Concept ACK, nice.

  6. scripts: add type annotations to macdeployqtplus 1c37e81694
  7. scripts: use format() in macdeployqtplus 51729a4dfa
  8. scripts: misc cleanups in macdeployqtplus 57cdd0697d
  9. scripts: filter more qt plugins we don't use in macdeployqtplus
    phonon is no longer a part of Qt as of version 5
    1ac7b7f66b
  10. fanquake force-pushed on Jul 29, 2019
  11. fanquake commented at 1:37 AM on July 29, 2019: member

    Updated to skip more plugins, including virtualkeyboard and imageformats.

  12. laanwj commented at 12:11 PM on July 29, 2019: member

    Huh, it's interesting how no longer referencing dynamic libraries results in such a change in executable size. Do they all get included in the app image?

  13. fanquake commented at 1:54 AM on July 30, 2019: member

    Huh, it's interesting how no longer referencing dynamic libraries results in such a change in executable size. Do they all get included in the app image?

    Yep the macdeployqtplus script copies .framework and .dylib files into the Bitcoin-Qt.app bundle. Using master, with Qt 5.13.0 installed via brew, that ends up looking like the below. QtWebEngineCore.framework is to blame for most of the bloat..

    /Volumes/Bitcoin-Core/Bitcoin-Qt.app/Contents/Frameworks:

    166M	QtWebEngineCore.framework
    5.8M	QtCore.framework
    5.6M	QtWidgets.framework
    5.3M	QtGui.framework
    4.2M	QtQml.framework
    4.0M	QtQuick.framework
    2.5M	Qt3DRender.framework
    1.7M	libcrypto.1.0.0.dylib
    1.7M	QtLocation.framework
    1.3M	libdb_cxx-4.8.dylib
    1.3M	QtNetwork.framework
    788K	QtVirtualKeyboard.framework
    636K	Qt3DExtras.framework
    492K	QtPositioning.framework
    476K	QtDBus.framework
    416K	QtWebEngine.framework
    404K	Qt3DInput.framework
    396K	Qt3DCore.framework
    392K	libzmq.5.dylib
    308K	QtPrintSupport.framework
    228K	libevent-2.1.6.dylib
    220K	QtSerialBus.framework
    212K	QtSql.framework
    172K	Qt3DQuick.framework
    160K	QtWebSockets.framework
    128K	QtWebChannel.framework
    120K	QtGamepad.framework
    112K	QtPositioningQuick.framework
    100K	Qt3DQuickScene2D.framework
     92K	libboost_filesystem.dylib
     88K	QtWebView.framework
     88K	QtSerialPort.framework
     84K	libboost_thread-mt.dylib
     60K	Qt3DLogic.framework
     52K	QtTextToSpeech.framework
     40K	libqrencode.4.dylib
     36K	libboost_chrono-mt.dylib
     36K	QtConcurrent.framework
     16K	libevent_pthreads-2.1.6.dylib
    8.0K	libboost_system.dylib
    

    /Volumes/Bitcoin-Core/Bitcoin-Qt.app/Contents/PlugIns:

    5.3M	geoservices
    4.9M	platforms
    3.0M	virtualkeyboard
    1.7M	imageformats
    392K	sceneparsers
    204K	styles
    184K	canbus
    140K	geometryloaders
    104K	webview
     80K	generic
     68K	platformthemes
     64K	gamepads
     52K	platforminputcontexts
     52K	bearer
     44K	texttospeech
     44K	renderplugins
     28K	printsupport
    
  14. laanwj commented at 1:36 PM on July 30, 2019: member

    That's … the worst of both worlds. Concept ACK anyway

  15. DrahtBot commented at 4:12 PM on July 30, 2019: member

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds for commit 68da54987df4d4b76d0696b8139ae2bb32394214 (master):

    Gitian builds for commit e5c174621ec8e85ab95055bb1846cb16ea8c548f (master and this pull):

  16. DrahtBot removed the label Needs gitian build on Jul 30, 2019
  17. laanwj commented at 7:23 AM on July 31, 2019: member

    ACK 1ac7b7f66bd53d2d719377c7e0ab8b38e970c88f (purely Python code review and the fact that this passes travis, cannot run this on a mac)

    With all the PRs shaving bits off Qt, it would be nice to have a document about what are all the different places a library needs to be added in case someone does want to add a qt module dependency.

  18. hebasto commented at 2:37 PM on August 27, 2019: member

    Concept ACK.

  19. dongcarl commented at 6:06 PM on September 9, 2019: member

    tested ACK 1ac7b7f66bd53d2d719377c7e0ab8b38e970c88f

    Tested that the dmg built correctly, Bitcoin Core ran, and the various pages of the GUI looks like they're working.

  20. fanquake referenced this in commit 59681beb89 on Sep 10, 2019
  21. fanquake merged this on Sep 10, 2019
  22. fanquake closed this on Sep 10, 2019

  23. fanquake removed review request from theuni on Sep 10, 2019
  24. fanquake deleted the branch on Sep 10, 2019
  25. sidhujag referenced this in commit 3b92ebfb6a on Sep 10, 2019
  26. jasonbcox referenced this in commit 9ea4510324 on Oct 16, 2020
  27. random-zebra referenced this in commit fbebade1e4 on Jun 11, 2021
  28. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me