build: Fix macdeployqtplus after switching to Qt 6 #32287

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:250416-macdeploy changing 2 files +11 −10
  1. hebasto commented at 12:39 pm on April 16, 2025: member

    Homebrew’s Qt 6 package — namely qt or qt@6 — introduces a few differences that must be properly handled by the macdeployqtplus script:

    1. Use of @rpath references:
     0% objdump --macho --dylibs-used $(brew --prefix qt@5)/Frameworks/QtGui.framework/QtGui
     1/usr/local/opt/qt@5/Frameworks/QtGui.framework/QtGui:
     2	/usr/local/opt/qt@5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.15.0, current version 5.15.16)
     3	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2575.30.19)
     4	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 367.6.0)
     5	/usr/local/Cellar/qt@5/5.15.16_1/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.15.0, current version 5.15.16)
     6	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
     7	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
     8	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1889.2.7)
     9	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3208.0.0)
    10	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    11	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    12	/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 64.0.0, current version 64.0.0)
    13	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
    14	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 65.0.0)
    15	/usr/local/opt/md4c/lib/libmd4c.0.dylib (compatibility version 0.0.0, current version 0.5.2)
    16	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.105.0)
    17	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
    18	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
    19	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 844.2.0)
    20	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    21% objdump --macho --dylibs-used $(brew --prefix qt@6)/Frameworks/QtGui.framework/QtGui
    22/usr/local/opt/qt/Frameworks/QtGui.framework/QtGui:
    23	/usr/local/opt/qt/lib/QtGui.framework/Versions/A/QtGui (compatibility version 6.0.0, current version 6.9.0)
    24	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2575.30.19)
    25	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 170.0.0)
    26	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    27	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
    28	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
    29	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1889.2.7)
    30	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 844.2.0)
    31	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3208.0.0)
    32	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    33	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 367.6.0)
    34	/usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 8401.0.0, current version 8401.0.0)	[@rpath](/bitcoin-bitcoin/contributor/rpath/)/QtDBus.framework/Versions/A/QtDBus (compatibility version 6.0.0, current version 6.9.0)
    35	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    36	/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 64.0.0, current version 64.0.0)
    37	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
    38	/usr/local/opt/harfbuzz/lib/libharfbuzz.0.dylib (compatibility version 61100.0.0, current version 61100.0.0)
    39	/usr/local/opt/md4c/lib/libmd4c.0.dylib (compatibility version 0.0.0, current version 0.5.2)
    40	/usr/local/opt/freetype/lib/libfreetype.6.dylib (compatibility version 27.0.0, current version 27.2.0)
    41	/usr/local/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 8401.0.0, current version 8401.0.0)	[@rpath](/bitcoin-bitcoin/contributor/rpath/)/QtCore.framework/Versions/A/QtCore (compatibility version 6.0.0, current version 6.9.0)
    42	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    43	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    44	/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0)
    45	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.105.0)
    46	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
    47	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
    48	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    
    1. Different directory layout:
     0% ls -l $(brew --prefix qt@5)/         
     1total 544
     2drwxr-xr-x   79 hebasto  admin    2528 13 Nov 06:22 Frameworks
     3-rw-r--r--    1 hebasto  admin    7533 16 Apr 09:09 INSTALL_RECEIPT.json
     4-rw-r--r--    1 hebasto  admin   22961 13 Nov 06:22 LICENSE.FDL
     5-rw-r--r--    1 hebasto  admin   36363 13 Nov 06:22 LICENSE.GPL3-EXCEPT
     6-rw-r--r--    1 hebasto  admin   15351 13 Nov 06:22 LICENSE.GPLv2
     7-rw-r--r--    1 hebasto  admin   35641 13 Nov 06:22 LICENSE.GPLv3
     8-rw-r--r--    1 hebasto  admin   26828 13 Nov 06:22 LICENSE.LGPLv21
     9-rw-r--r--    1 hebasto  admin    8174 13 Nov 06:22 LICENSE.LGPLv3
    10-rw-r--r--    1 hebasto  admin  106262 13 Nov 06:22 LICENSE.QT-LICENSE-AGREEMENT
    11-rw-r--r--    1 hebasto  admin    3842 13 Nov 06:22 README
    12drwxr-xr-x   57 hebasto  admin    1824 16 Apr 09:09 bin
    13drwxr-xr-x    4 hebasto  admin     128 13 Nov 06:22 doc
    14drwxr-xr-x   95 hebasto  admin    3040 13 Nov 06:22 include
    15drwxr-xr-x  119 hebasto  admin    3808 16 Apr 09:09 lib
    16drwxr-xr-x    8 hebasto  admin     256 13 Nov 06:22 libexec
    17drwxr-xr-x   79 hebasto  admin    2528 16 Apr 09:09 mkspecs
    18drwxr-xr-x   15 hebasto  admin     480 13 Nov 06:22 phrasebooks
    19drwxr-xr-x   31 hebasto  admin     992 13 Nov 06:22 plugins
    20drwxr-xr-x   28 hebasto  admin     896 13 Nov 06:22 qml
    21-rw-r--r--    1 hebasto  admin    6952 16 Apr 09:09 sbom.spdx.json
    22drwxr-xr-x    3 hebasto  admin      96 13 Nov 06:22 share
    23drwxr-xr-x  347 hebasto  admin   11104 13 Nov 06:22 translations
    24% ls -l $(brew --prefix qt@6)/share/qt/
    25total 0
    26drwxr-xr-x    4 hebasto  admin   128 30 Mar 09:49 doc
    27drwxr-xr-x   35 hebasto  admin  1120 16 Apr 09:16 libexec
    28drwxr-xr-x  167 hebasto  admin  5344 30 Mar 09:49 metatypes
    29drwxr-xr-x   70 hebasto  admin  2240 16 Apr 09:16 mkspecs
    30drwxr-xr-x  178 hebasto  admin  5696 30 Mar 09:49 modules
    31drwxr-xr-x   15 hebasto  admin   480 30 Mar 09:49 phrasebooks
    32drwxr-xr-x   31 hebasto  admin   992 30 Mar 09:49 plugins
    33drwxr-xr-x   34 hebasto  admin  1088 30 Mar 09:49 qml
    34drwxr-xr-x   45 hebasto  admin  1440 30 Mar 09:49 sbom
    35drwxr-xr-x  285 hebasto  admin  9120 30 Mar 09:49 translations
    

    This PR addresses both issues and additionally adds a deploy target to the native macOS CI job to prevent any similar recessions in the future.

    Fixes #32267.

  2. build: Resolve `@rpath` in `macdeployqtplus`
    Extend `getFrameworks()` with an optional `rpath` parameter to replace
    `@rpath` in dependency paths. This fixes resolution of framework
    dependencies when using Homebrew's `qt@6` package.
    938208d91a
  3. hebasto added the label macOS on Apr 16, 2025
  4. hebasto added the label Build system on Apr 16, 2025
  5. hebasto added the label Tests on Apr 16, 2025
  6. DrahtBot commented at 12:39 pm on April 16, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32287.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake
    Stale ACK i-am-yuvi

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  7. i-am-yuvi commented at 7:28 am on April 20, 2025: contributor

    tACK b2f1c20d24ee6cae65e7bbff60091b39cc2694b4

     0...
     1...
     2+ Deploying plugins +
     3Processing plugin platforms/libqminimal.dylib ...
     4/Library/Developer/CommandLineTools/usr/bin/strip: warning: changes being made to the file will invalidate the code signature in: /Users/yuvrajchhetri/Desktop/bitcoin/build/dist/Bitcoin-Qt.app/Contents/PlugIns/platforms/libqminimal.dylib
     5/Library/Developer/CommandLineTools/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: dist/Bitcoin-Qt.app/Contents/PlugIns/platforms/libqminimal.dylib
     6/Library/Developer/CommandLineTools/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: dist/Bitcoin-Qt.app/Contents/PlugIns/platforms/libqminimal.dylib
     7Processing plugin platforms/libqcocoa.dylib ...
     8Processing plugin styles/libqmacstyle.dylib ...
     9+ Adding Qt translations +
    10+ Installing qt.conf +
    11dist/Bitcoin-Qt.app: replacing existing signature
    12+ Done +
    13[100%] Built target deploydir
    14[100%] Built target deploy
    
  8. in contrib/macdeploy/macdeployqtplus:163 in b2f1c20d24 outdated
    161+
    162     def detectQtPath(self, frameworkDirectory: str):
    163         parentDir = os.path.dirname(frameworkDirectory)
    164-        if os.path.exists(os.path.join(parentDir, "translations")):
    165-            # Classic layout, e.g. "/usr/local/Trolltech/Qt-4.x.x"
    166+        if os.path.exists(os.path.join(parentDir, "translations")) or os.path.exists(os.path.join(parentDir, "share", "qt", "translations")):
    


    fanquake commented at 3:33 pm on April 25, 2025:
    In f7bd54d5f34361c0c06dc86fbd8e2497e7e4473c: Why are we adding support for 6, while retaining support for 5, if we now require 6?

    hebasto commented at 6:31 pm on April 25, 2025:
    Thanks! Adjusted.
  9. hebasto force-pushed on Apr 25, 2025
  10. in contrib/macdeploy/macdeployqtplus:169 in 2b19ac7aba outdated
    171         if self.qtPath is not None:
    172-            pluginPath = os.path.join(self.qtPath, "plugins")
    173-            if os.path.exists(pluginPath):
    174-                self.pluginPath = pluginPath
    175-    
    176+            pluginPathCandidates = [
    


    fanquake commented at 9:06 pm on April 25, 2025:
    Same Q here as above.

    hebasto commented at 7:03 am on April 26, 2025:
    Thanks! Adjusted as well.
  11. build: Fix `macdeployqtplus` after switching to Qt 6
    Homebrew’s `qt@6` package places the `translations` and `plugins`
    directories in the `share/qt` subdirectory.
    This change updates the `macdeployqtplus` script accordingly.
    fad57e9e0f
  12. ci: Add `deploy` target for native macOS CI job 84de8c93e7
  13. hebasto force-pushed on Apr 26, 2025
  14. fanquake approved
  15. fanquake commented at 5:09 pm on May 6, 2025: member
    ACK 84de8c93e7d4979575161a2bb8f7eb64e1317b89
  16. DrahtBot requested review from i-am-yuvi on May 6, 2025
  17. fanquake merged this on May 6, 2025
  18. fanquake closed this on May 6, 2025

  19. hebasto deleted the branch on May 6, 2025

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: 2025-05-09 21:12 UTC

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