Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented May 23, 2022

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 #24798.

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

# brew remove qt@5
# brew install qt
# ./autogen.sh
# ./configure --with-gui=qt6
# make clean 
# make
# 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.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 23, 2022

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.

hebasto added 3 commits May 24, 2022 11:08
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
@hebasto hebasto force-pushed the 220523-qt6-mac branch 2 times, most recently from a232ae6 to e944b0e Compare May 24, 2022 12:22
@hebasto hebasto marked this pull request as ready for review May 24, 2022 15:46
@laanwj
Copy link
Member

laanwj commented May 26, 2022

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.

@hebasto
Copy link
Member Author

hebasto commented May 26, 2022

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.

@fanquake
Copy link
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.

@Sjors
Copy link
Member

Sjors commented May 30, 2022

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.

@fanquake
Copy link
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

@hebasto
Copy link
Member Author

hebasto commented May 30, 2022

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

We do :)

@Sjors
Copy link
Member

Sjors commented May 30, 2022

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:

Processing QtDBus.framework ...
Error: No directory at @rpath/QtDBus.framework
make: *** [Bitcoin-Core.dmg] Error 1

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

glitch

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 2, 2022

🐙 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".

@hebasto
Copy link
Member Author

hebasto commented Jun 12, 2022

CMake is going to make it much more elegant.

@hebasto hebasto closed this Jun 12, 2022
@hebasto hebasto mentioned this pull request Aug 7, 2022
16 tasks
@bitcoin bitcoin locked and limited conversation to collaborators Jun 12, 2023
@hebasto hebasto deleted the 220523-qt6-mac branch October 25, 2024 09:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants