build: Make --with-gui=qt6 configure option available on macOS #25191

pull hebasto wants to merge 5 commits into bitcoin:master from hebasto:220523-qt6-mac changing 9 files +90 −50
  1. hebasto commented at 7:47 pm on May 23, 2022: member

    This is another (however, not alternative; rather OS-specific) approach to bring Qt 6 to Bitcoin Core GUI users.

    In Qt 6 most of the libraries are built as frameworks (by default), therefore, this PR is much less invasive and (I hope) less controversial then bitcoin/bitcoin#24798.

    To test this PR on macOS (both Intel-based and Apple Silicon) just

    0# brew remove qt@5
    1# brew install qt
    2# ./autogen.sh
    3# ./configure --with-gui=qt6
    4# make clean 
    5# make
    6# make check
    

    The other benefit of this PR is keeping our Qt code base compatible with Qt 6 due to the CI task which runs --with-gui=qt6.

    Documentation update and guarding calls which are deprecated in Qt 6 are left for follow ups to keep this PR focused on build stuff.

    Based on multiple PRs in the GUI repo which get code base compatible with Qt 6, and only the last two commits belong to this PR.

  2. hebasto added the label GUI on May 23, 2022
  3. hebasto added the label macOS on May 23, 2022
  4. hebasto added the label Build system on May 23, 2022
  5. hebasto force-pushed on May 23, 2022
  6. DrahtBot commented at 9:52 pm on May 23, 2022: contributor

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25160 (ci: Add “macOS 12 native arm64” task by hebasto)
    • #25110 (tidy: use modernize-use-raw-string-literal by fanquake)
    • #24813 (build: Getting ready to Qt 6 (4/n). Improve build-aux/m4/bitcoin_qt.m4 by hebasto)
    • #24798 ([POC] build: Hello Qt 6 by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. qt: Replace QRegExp with QRegularExpression 90b493eb0e
  8. qt6: Fix type registration
    In Qt 6, registration of `QDataStream` streaming operators is done
    automatically. Consequently, `qRegisterMetaTypeStreamOperators()` does
    no longer exist. Calls to this method have to be removed when porting
    to Qt 6.
    
    See https://doc.qt.io/qt-6/qtcore-changes-qt6.html
    766a07e6d4
  9. qt6: Fix builds which are configured with `--disable-wallet` 96a90704c2
  10. hebasto force-pushed on May 24, 2022
  11. hebasto force-pushed on May 24, 2022
  12. build: Make `--with-gui=qt6` configure option available on macOS c7d9048bcc
  13. ci: Use Qt 6 on macOS 12 native task 05404709a4
  14. hebasto force-pushed on May 24, 2022
  15. hebasto marked this as ready for review on May 24, 2022
  16. laanwj commented at 7:49 am on May 26, 2022: member
    I’m not sure, ACK on --with-gui=qt6 in general but I really don’t like the idea of having qt6 support for MacOS only. For one, I can’t test it.
  17. hebasto commented at 8:37 am on May 26, 2022: member

    I’m not sure, ACK on --with-gui=qt6 in general but I really don’t like the idea of having qt6 support for MacOS only. For one, I can’t test it.

    The other part, having Qt 6 in depends, is in #24798.

    Building with dynamical linking against system Qt 6 on Linux does not look like a task worth taking on without CMake.

  18. fanquake commented at 9:32 am on May 28, 2022: member
    Concept ~0. It feels like support for Qt6 is trying to be pushed into our codebase before it’s ready / generally usable. I’m not sure why we need to add support, right now, for only a specific package manager, on a single OS.
  19. Sjors commented at 1:30 pm on May 30, 2022: member
    So it looks like macOS installs QT 6 by default if you do brew install qt. In fact a brew upgrade will silently bump the major version. So we need to either tell users to install qt@5 or support 6. So far I haven’t noticed any issues compiling master by the way. But I’ll give this a test too.
  20. fanquake commented at 1:33 pm on May 30, 2022: member

    So it looks like macOS installs QT 6 by default if you do brew install qt.

    This has already been the case for more than a year: #21346.

    So we need to either tell users to install qt@5

    We already do. https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#qt

  21. hebasto commented at 1:33 pm on May 30, 2022: member

    So we need to … tell users to install qt@5

    We do :)

  22. Sjors commented at 1:34 pm on May 30, 2022: member

    Ah ok, that might explain why I also have qt@5 on my system :-)

    Fortunately I have two macs, so I can test brew remove qt@5 on one of them.

    Having this PR open seems useful in any case, so we can avoid surprises when do decide to upgrade.

    On macOS 12.4 (Intel) with qt 6.3.0 via homebrew, my ./configure … --with-gui=qt6 happily builds.

    So far not issues running QT. Make deploy fails though:

    0Processing QtDBus.framework ...
    1Error: No directory at [@rpath](/bitcoin-bitcoin/contributor/rpath/)/QtDBus.framework
    2make: *** [Bitcoin-Core.dmg] Error 1
    

    Update 2022-06-06 found a glitch (at least in the make deploy version): transactions are blank.

  23. DrahtBot added the label Needs rebase on Jun 2, 2022
  24. DrahtBot commented at 6:37 pm on June 2, 2022: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

    Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a “draft”.

  25. hebasto commented at 8:41 pm on June 12, 2022: member
    CMake is going to make it much more elegant.
  26. hebasto closed this on Jun 12, 2022

  27. bitcoin locked this on Jun 12, 2023
  28. hebasto deleted the branch on Oct 25, 2024

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

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