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:
    % objdump --macho --dylibs-used $(brew --prefix qt@5)/Frameworks/QtGui.framework/QtGui
    /usr/local/opt/qt@5/Frameworks/QtGui.framework/QtGui:
    	/usr/local/opt/qt@5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.15.0, current version 5.15.16)
    	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2575.30.19)
    	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 367.6.0)
    	/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)
    	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1889.2.7)
    	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3208.0.0)
    	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    	/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 64.0.0, current version 64.0.0)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
    	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 65.0.0)
    	/usr/local/opt/md4c/lib/libmd4c.0.dylib (compatibility version 0.0.0, current version 0.5.2)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.105.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
    	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 844.2.0)
    	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    % objdump --macho --dylibs-used $(brew --prefix qt@6)/Frameworks/QtGui.framework/QtGui
    /usr/local/opt/qt/Frameworks/QtGui.framework/QtGui:
    	/usr/local/opt/qt/lib/QtGui.framework/Versions/A/QtGui (compatibility version 6.0.0, current version 6.9.0)
    	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2575.30.19)
    	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 170.0.0)
    	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
    	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1889.2.7)
    	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 844.2.0)
    	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3208.0.0)
    	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 367.6.0)
    	/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)
    	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    	/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 64.0.0, current version 64.0.0)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
    	/usr/local/opt/harfbuzz/lib/libharfbuzz.0.dylib (compatibility version 61100.0.0, current version 61100.0.0)
    	/usr/local/opt/md4c/lib/libmd4c.0.dylib (compatibility version 0.0.0, current version 0.5.2)
    	/usr/local/opt/freetype/lib/libfreetype.6.dylib (compatibility version 27.0.0, current version 27.2.0)
    	/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)
    	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.105.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
    	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
    	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    
    1. Different directory layout:
    % ls -l $(brew --prefix qt@5)/         
    total 544
    drwxr-xr-x   79 hebasto  admin    2528 13 Nov 06:22 Frameworks
    -rw-r--r--    1 hebasto  admin    7533 16 Apr 09:09 INSTALL_RECEIPT.json
    -rw-r--r--    1 hebasto  admin   22961 13 Nov 06:22 LICENSE.FDL
    -rw-r--r--    1 hebasto  admin   36363 13 Nov 06:22 LICENSE.GPL3-EXCEPT
    -rw-r--r--    1 hebasto  admin   15351 13 Nov 06:22 LICENSE.GPLv2
    -rw-r--r--    1 hebasto  admin   35641 13 Nov 06:22 LICENSE.GPLv3
    -rw-r--r--    1 hebasto  admin   26828 13 Nov 06:22 LICENSE.LGPLv21
    -rw-r--r--    1 hebasto  admin    8174 13 Nov 06:22 LICENSE.LGPLv3
    -rw-r--r--    1 hebasto  admin  106262 13 Nov 06:22 LICENSE.QT-LICENSE-AGREEMENT
    -rw-r--r--    1 hebasto  admin    3842 13 Nov 06:22 README
    drwxr-xr-x   57 hebasto  admin    1824 16 Apr 09:09 bin
    drwxr-xr-x    4 hebasto  admin     128 13 Nov 06:22 doc
    drwxr-xr-x   95 hebasto  admin    3040 13 Nov 06:22 include
    drwxr-xr-x  119 hebasto  admin    3808 16 Apr 09:09 lib
    drwxr-xr-x    8 hebasto  admin     256 13 Nov 06:22 libexec
    drwxr-xr-x   79 hebasto  admin    2528 16 Apr 09:09 mkspecs
    drwxr-xr-x   15 hebasto  admin     480 13 Nov 06:22 phrasebooks
    drwxr-xr-x   31 hebasto  admin     992 13 Nov 06:22 plugins
    drwxr-xr-x   28 hebasto  admin     896 13 Nov 06:22 qml
    -rw-r--r--    1 hebasto  admin    6952 16 Apr 09:09 sbom.spdx.json
    drwxr-xr-x    3 hebasto  admin      96 13 Nov 06:22 share
    drwxr-xr-x  347 hebasto  admin   11104 13 Nov 06:22 translations
    % ls -l $(brew --prefix qt@6)/share/qt/
    total 0
    drwxr-xr-x    4 hebasto  admin   128 30 Mar 09:49 doc
    drwxr-xr-x   35 hebasto  admin  1120 16 Apr 09:16 libexec
    drwxr-xr-x  167 hebasto  admin  5344 30 Mar 09:49 metatypes
    drwxr-xr-x   70 hebasto  admin  2240 16 Apr 09:16 mkspecs
    drwxr-xr-x  178 hebasto  admin  5696 30 Mar 09:49 modules
    drwxr-xr-x   15 hebasto  admin   480 30 Mar 09:49 phrasebooks
    drwxr-xr-x   31 hebasto  admin   992 30 Mar 09:49 plugins
    drwxr-xr-x   34 hebasto  admin  1088 30 Mar 09:49 qml
    drwxr-xr-x   45 hebasto  admin  1440 30 Mar 09:49 sbom
    drwxr-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

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

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

    tACK b2f1c20d24ee6cae65e7bbff60091b39cc2694b4

    ...
    ...
    + Deploying plugins +
    Processing plugin platforms/libqminimal.dylib ...
    /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
    /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
    /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
    Processing plugin platforms/libqcocoa.dylib ...
    Processing plugin styles/libqmacstyle.dylib ...
    + Adding Qt translations +
    + Installing qt.conf +
    dist/Bitcoin-Qt.app: replacing existing signature
    + Done +
    [100%] Built target deploydir
    [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
  20. i-am-yuvi commented at 6:38 AM on May 15, 2025: contributor

    re-ACK 84de8c93e7d4979575161a2bb8f7eb64e1317b89


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-21 18:12 UTC

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