Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Switch to Qt 6 #30997

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

build: Switch to Qt 6 #30997

wants to merge 11 commits into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Sep 28, 2024

The currently used Qt 5.15 is approaching EOL. The recent migration of the Bitcoin Core's build system to CMake makes it possible to switch to Qt 6.

This PR updates the OS runtime compatibility requirements for the Bitcoin Core GUI as follows:

1. Linux

Starting with Qt 6.5.0, the libxcb-cursor0 package is required to be installed at runtime.

2. Windows

Qt 6 requires Windows 10 (1809 or later) / Windows 11 (also see #31172). The new code expects Qt 6.7 or newer, which holds automatically for cross-compiled builds. A new style plugin causes minor visual glitches that will be fixed in follow-ups.

3. macOS

bitcoin-qt now uses the Metal backend.


IMPORTANT. Don't forget to install Ninja.


For historical context, please refer to:


UPD 2024-10-09. Qt 6.8 has been released, but it has some drawbacks for us. As a result, this PR will stick to Qt 6.7.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 28, 2024

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/30997.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK jonatack, promag, laanwj, Zero-1729, BrandonOdiwuor
Stale ACK pablomartin4btc

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31358 (depends: Avoid hardcoding host_prefix in toolchain file by hebasto)
  • #31349 (ci: detect outbound internet traffic generated while running tests by vasild)
  • #31308 (ci, iwyu: Treat warnings as errors for specific targets by hebasto)
  • #31306 (ci: Update Clang in "tidy" job by hebasto)
  • #31233 (cmake: Improve robustness and usability by hebasto)
  • #30975 (Add multiprocess binaries to release build by Sjors)
  • #25573 ([POC] guix: produce a fully -static-pie bitcoind by fanquake)
  • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
  • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
  • #10102 (Multiprocess bitcoin by ryanofsky)

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 hebasto force-pushed the 240928-qt6 branch 5 times, most recently from 8669ed0 to b9c75dc Compare September 28, 2024 23:31
@jarolrod
Copy link
Member

concept ack 🌞

@Sjors
Copy link
Member

Sjors commented Sep 30, 2024

macOS Monterey 12 hardware support: https://support.apple.com/en-us/103260
macOS Big Sur 11 hardware support: https://support.apple.com/en-us/111980

Those differ by about a year. By time this is released, Monterey will work on ten year old machines. So I think it's fine to drop Big Sur (for Qt).

Don't forget to update build-osx.md.

@maflcko
Copy link
Member

maflcko commented Sep 30, 2024

The bump for Ubuntu seems fine as well. There's already the requirement from #29987 for all binaries, so going one LTS further for the GUI seems fine.

@maflcko
Copy link
Member

maflcko commented Sep 30, 2024

Don't forget to update build-osx.md.

I don't think the gui requirements are documented anywhere, because for now they were always equal to the daemon requirements? Possibly just saying globally "qt6" is required implies the additional requirement on the OS?

@Sjors
Copy link
Member

Sjors commented Sep 30, 2024

@maflcko I think it's just three places that need a change / consideration:

  • brew install qt@5 -> qt or qt@6
  • require ninja? (in depends/README.md)
  • "For macOS 11 (Big Sur) and 12 (Monterey)": IIUC this doesn't change, except that QT won't work with 11. Not sure how to best document that.

Loading a descriptor wallet with the GUI resulted in an error popup:

Error: SQLiteDatabase: Failed to configure serialized threading mode: bad parameter or other API misuse

The log also says:

2024-09-30T08:08:04Z [qt-init] SQLite Error. Code: 21. Message: misuse at line 185577 of [1b37c146ee]

Using SQLite Version 3.43.2 and Qt 6.7.2 via Homebrew on Intel macOS 15.0 as well as 13.7.

Seems odd the QT update would impact the wallet at all. Also happens when creating a fresh wallet in the GUI.

@Sjors
Copy link
Member

Sjors commented Sep 30, 2024

Building depends fails for me, maybe something wrong with qttools_skip_dependencies.patch?

CMake Error at qtbase/cmake/QtTargetHelpers.cmake:171 (target_link_libraries):
  Target "linguist" links to:

    Qt::PrintSupport

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  qtbase/cmake/QtExecutableHelpers.cmake:120 (qt_internal_extend_target)
  qtbase/cmake/QtAppHelpers.cmake:46 (qt_internal_add_executable)
  qttools/src/linguist/linguist/CMakeLists.txt:8 (qt_internal_add_app)

@hebasto
Copy link
Member Author

hebasto commented Sep 30, 2024

@Sjors

Building depends fails for me, maybe something wrong with qttools_skip_dependencies.patch?

What's your build platform and the value of the HOST variable?

UPD. If you build on macOS, does the following diff help:

--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -120,7 +120,7 @@ $(package)_config_opts_darwin += -no-feature-vulkan
 $(package)_config_opts_linux = -xcb
 $(package)_config_opts_linux += -no-xcb-xlib
 $(package)_config_opts_linux += -no-feature-xlib
-$(package)_config_opts_linux += -no-feature-process
+$(package)_config_opts += -no-feature-process
 $(package)_config_opts_linux += -system-freetype
 $(package)_config_opts_linux += -fontconfig
 $(package)_config_opts_linux += -no-opengl

?

hebasto added a commit to hebasto/bitcoin that referenced this pull request Nov 22, 2024
This is required to workaround the cache contaminated by unversioned
files in the early versions of this branch.

Can be dropped after cleaning the cache in the Cirrus CI infra.

Suggested in bitcoin#30997 (comment)
achow101 added a commit that referenced this pull request Nov 26, 2024
ee1128e doc: update stack-clash-protection comment re mingw-w64 (fanquake)
bf47448 test: drop check for Windows < 10 (fanquake)
35b898c release: target Windows 10 or later (fanquake)
398754e depends: target Windows 10 when building for mingw-w64 (fanquake)

Pull request description:

  Follows up to #31048 (comment).

  We definitely cannot claim that Bitcoin Core is "supported and extensively tested on" on Windows 7.

  Note that #30997 is also increasing the minimum required Windows version (for the GUI) to 10.

ACKs for top commit:
  hodlinator:
    cr-ACK ee1128e
  davidgumberg:
    ACK ee1128e
  achow101:
    ACK ee1128e
  hebasto:
    re-ACK ee1128e, only rebased, a commit message and a comment have been amended since my recent [review](#31172 (review)).
  TheCharlatan:
    ACK ee1128e

Tree-SHA512: 245e0bac3d63414d919a1948661fef4ff79359faaacaf19d64abd91cc62e822797fb1cf3379e340bfdf9a85c0b88fd99a90eda450dd4218b6213ab78aefb1374
@Sjors
Copy link
Member

Sjors commented Nov 29, 2024

Tested 346218a on:

  • Intel macOS 13.7.1 with depends as well as qt 6.7.3 from homebrew
  • Apple Silicon macOS 15.1.1 with depends as well as qt 6.7.3 from homebrew
  • Ubuntu 24.10 with Wayland, with depends as well as qt-wayland
  • A guix build tested on Windows 11
  • Guix build tested on the first three machines

Starting with Qt 6.5.0, the libxcb-cursor0 package is required to be installed at runtime.

There's no mention of this in build-unix.md or depends/README.md.

It also seems that regular Linux users need to install this in order to use the Guix release. That seems potentially problematic.

For the non-depends build on Ubuntu there's a weird animation when you move between tabs, but that seems to be a wayland issue which happens in Qt5 as well (though it seems to be slightly worse). It doesn't impact the guix release builds.

Guix hashes:

arm64 and x86_64
6ec110435c0e6923769c7d0edf8fc23b615e72344a37fecb63a0e6e88ec1461d  guix-build-346218ae614a/output/aarch64-linux-gnu/SHA256SUMS.part
9b5aa0591161f73d754f2af845fc2488387e3252d10d9d85c99b6b5f927240b7  guix-build-346218ae614a/output/aarch64-linux-gnu/bitcoin-346218ae614a-aarch64-linux-gnu-debug.tar.gz
910697bf9850bad2d604017b60047f23b6c56eeb269ea17a7583cf39f0017e68  guix-build-346218ae614a/output/aarch64-linux-gnu/bitcoin-346218ae614a-aarch64-linux-gnu.tar.gz
f6ec20eb4e8a9bc50a87f7b37719c8baa5ab1534419caa1bcf194dced420cb5f  guix-build-346218ae614a/output/arm-linux-gnueabihf/SHA256SUMS.part
e91f13cf66a4eae9d6cd86ddc23d563a610ea27213504c849d73c173fa76eca2  guix-build-346218ae614a/output/arm-linux-gnueabihf/bitcoin-346218ae614a-arm-linux-gnueabihf-debug.tar.gz
d461f44c577d6cc0ab7864fa546c6fb5d03af211b6107e3722aa300b40fa58c0  guix-build-346218ae614a/output/arm-linux-gnueabihf/bitcoin-346218ae614a-arm-linux-gnueabihf.tar.gz
c64e406732283a5a2b15fd9e2f992ab23d4fbac821f3a177095ae354d64e6742  guix-build-346218ae614a/output/arm64-apple-darwin/SHA256SUMS.part
c6380eae7c484f5017cedbbbcc52f94fa3b876cda5f59a35ca3b22492fe8f7b8  guix-build-346218ae614a/output/arm64-apple-darwin/bitcoin-346218ae614a-arm64-apple-darwin-unsigned.tar.gz
aab8442cb77c101170ef9ebf592702fcbdf8cdfdacb43933e45816e4714daf67  guix-build-346218ae614a/output/arm64-apple-darwin/bitcoin-346218ae614a-arm64-apple-darwin-unsigned.zip
b04049328959493d7c3988eea7feff3f64a3307093c2f3de90593b2b88cf1ef8  guix-build-346218ae614a/output/arm64-apple-darwin/bitcoin-346218ae614a-arm64-apple-darwin.tar.gz
a627cab8dfd4156c35d172b687015d71edd09a99eed59d75139dcb37a03e2ce9  guix-build-346218ae614a/output/dist-archive/bitcoin-346218ae614a.tar.gz
18e1ce84dad9d2ccfcaa68f89b1e9c154395f9dff2aa7c8de0119052147987ac  guix-build-346218ae614a/output/powerpc64-linux-gnu/SHA256SUMS.part
5584eb857e9b5775e0daa476480241d2b8408f2be5ff87adb44878ef0aa0d2df  guix-build-346218ae614a/output/powerpc64-linux-gnu/bitcoin-346218ae614a-powerpc64-linux-gnu-debug.tar.gz
3c93ee1942442865f2e7aad5e11ecb5a08e53de94fdf9b7953791268c593bc35  guix-build-346218ae614a/output/powerpc64-linux-gnu/bitcoin-346218ae614a-powerpc64-linux-gnu.tar.gz
571ba7baaeb26f6ca98ed78f6633c93cf2e5c7ead7366306a79823edddca8e7e  guix-build-346218ae614a/output/riscv64-linux-gnu/SHA256SUMS.part
37d3a873d2de40ad5a1651ffbf14272ddd1eceaa00bd860ed558bbc191ff191c  guix-build-346218ae614a/output/riscv64-linux-gnu/bitcoin-346218ae614a-riscv64-linux-gnu-debug.tar.gz
a2e207ceaae9c9c6b472c432cc0fdaf794baa92422094cb264dff5bcbcb21a31  guix-build-346218ae614a/output/riscv64-linux-gnu/bitcoin-346218ae614a-riscv64-linux-gnu.tar.gz
7c3c6709b63c7adf931b92cb6807f09aaa81d619010ec0e99701f7bfe88051f4  guix-build-346218ae614a/output/x86_64-apple-darwin/SHA256SUMS.part
f0e118bf5557125eb28d8dd1cc2a010a87f2e0a5f8b9832f40ebe69ef48f7ee5  guix-build-346218ae614a/output/x86_64-apple-darwin/bitcoin-346218ae614a-x86_64-apple-darwin-unsigned.tar.gz
0cddaf1c5049b9b24a7b742d90550b0be1c9f60872f2380cd7831a244bcf20fb  guix-build-346218ae614a/output/x86_64-apple-darwin/bitcoin-346218ae614a-x86_64-apple-darwin-unsigned.zip
8314a7640971ce30c9c46b8abe36e5b5bd8deca17b694d42a045a7eddbdc6bc1  guix-build-346218ae614a/output/x86_64-apple-darwin/bitcoin-346218ae614a-x86_64-apple-darwin.tar.gz
1664b9256f5ae33c9d64b1f2313b7e9afd5f3f5cc1c5db08d09141293ddb8759  guix-build-346218ae614a/output/x86_64-linux-gnu/SHA256SUMS.part
62c0c88624de7e8efbadb7323a98d6c0b5b7087d7ce8c52f6aa04be9a087c388  guix-build-346218ae614a/output/x86_64-linux-gnu/bitcoin-346218ae614a-x86_64-linux-gnu-debug.tar.gz
564d4d4733b99b6201ca2e7ead52fe728cc89e49e7105a98beb230b8be62c4cb  guix-build-346218ae614a/output/x86_64-linux-gnu/bitcoin-346218ae614a-x86_64-linux-gnu.tar.gz
a10cdca11ce23e0344bb7db3e24623141e7a7b789b83f133c9036c3d40767471  guix-build-346218ae614a/output/x86_64-w64-mingw32/SHA256SUMS.part
03f9fa1f0cf1558353d6cf0b6f0ab48c4fe9f353aeb7d51e60a1a73632aa840e  guix-build-346218ae614a/output/x86_64-w64-mingw32/bitcoin-346218ae614a-win64-debug.zip
7e441da57794ce20047fc98f7cbe4b827eea6ad5a5a86fc529251e323b5cbc8f  guix-build-346218ae614a/output/x86_64-w64-mingw32/bitcoin-346218ae614a-win64-setup-unsigned.exe
01d743c2216fd5dc70e1b03dc5113d68ad330464a8a279ba1f4b04d42418f88f  guix-build-346218ae614a/output/x86_64-w64-mingw32/bitcoin-346218ae614a-win64-unsigned.tar.gz
d392696692a44dd9e6fe69349dc101159b515eaad860637ae7086a5d6ef76bd7  guix-build-346218ae614a/output/x86_64-w64-mingw32/bitcoin-346218ae614a-win64.zip

@@ -3,6 +3,7 @@
(gnu packages bison)
((gnu packages certs) #:select (nss-certs))
((gnu packages cmake) #:select (cmake-minimal))
(gnu packages ninja)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

758c41a: is there anything other than QT in our guix build that will magically start using ninja once we add it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no. See #31171.

@hebasto
Copy link
Member Author

hebasto commented Dec 2, 2024

Rebased.

Starting with Qt 6.5.0, the libxcb-cursor0 package is required to be installed at runtime.

There's no mention of this in build-unix.md or depends/README.md.

Amended.

sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools
sudo apt-get install qt6-base-dev qt6-tools-dev qt6-l10n-tools

For Qt 6.5 and later, the `libxcb-cursor0` package must be installed at runtime.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that the self-compilation documentation is the right place to put a note about a runtime requirement for the guix built release binaries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest?

Copy link
Member

@laanwj laanwj Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we not linking this library statically like the other xcb- libraries? they're trivial protocol shims

uhh, sorry, that was dumb, we actually require all of xcb at runtime:

 0x0000000000000001 (NEEDED)             Shared library: [libxcb-icccm.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-image.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-shm.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-keysyms.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-randr.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-render-util.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-render.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-shape.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-sync.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-xfixes.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-xinerama.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb-xkb.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libxcb.so.1]

there's no reason to not require cursor as well, and no need to mention it specifically.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 8, 2024

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

This change helps avoid patch duplication between a package and its
native counterpart.
Unlike Qt 5, Qt 6 requires a separate native Qt build for
cross-building.

See: https://www.qt.io/blog/qt-6-build-system.
Static builds for Windows now require Qt 6.7 or newer. This holds
automatically to cross-compiled builds.
1. Do not set `C{PLUS}_INCLUDE_PATH` variables for Darwin builds

When cross-building for macOS, the `C{PLUS}_INCLUDE_PATH` environment
variables modify the default include directories for both native GCC and
cross Clang compilers, which is overkill and undesirable for the latter.

This change avoids setting the `C{PLUS}_INCLUDE_PATH` environment
variables and instead sets the required `-isystem` flags for the native
compiler explicitly.

2. Add `ninja` package.

3. Adjust allowed symbol lists.
@hebasto
Copy link
Member Author

hebasto commented Dec 12, 2024

Rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.