build: Switch to Qt 6 - #30997
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/30997. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
8669ed0 to
b9c75dc
Compare
|
concept ack 🌞 |
4d4bbec to
1b6e51f
Compare
9b3cb97 to
d2bc3fc
Compare
|
macOS Monterey 12 hardware support: https://support.apple.com/en-us/103260 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 |
|
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. |
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? |
|
@maflcko I think it's just three places that need a change / consideration:
Loading a descriptor wallet with the GUI resulted in an error popup:
The log also says:
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. |
|
Building depends fails for me, maybe something wrong with |
What's your build platform and the value of the 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? |
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
The build system for Qt 6 differs entirely from that of Qt 5. Building a
set of native Qt 6 tools now forms a separate step when cross-compiling.
Under these new circumstances, the `C{PLUS}_INCLUDE_PATH` environment
variables may alter the default include directories for both native and
cross compilers.
Previously, we explicitly unset these variables when invoking clang for
cross-compiling; however, that approach proved suboptimal (see bitcoin#30451).
This change sets the native toolchain for dependencies explicitly,
rather than relying on the `C{PLUS}_INCLUDE_PATH` environment variables.
Additionally, it facilitates the transition towards using clang for
building native tools when cross-compiling for macOS.
2. Add `ninja` package.
3. Adjust allowed symbol lists.
|
Updated c486157 -> f003457 (pr30997.74 -> pr30997.75, diff).
Thanks! The URLs have been updated. |
hodlinator
left a comment
There was a problem hiding this comment.
re-ACK f003457
Only updated Qt download URL since previous ACK.
|
My Guix builds for both |
|
Concept ACK I haven't looked at changes to QT itself at all though. I only glanced over the build changes here, but it's clear they got a ton of review by others. Not only is Qt 5.15 EOL, there are no further 5.x releases. We can't possibly maintain that ourself, so upgrading seems like the only sane path forward. I also agree we should do this early in the v30 cycle. Tested f003457 on macOS 15.4 (M4) as well as macOS 13.7.5 (Intel) with qt 6.8.2 and ninja installed via Homebrew. I also tested a depends build (using I also tested the guix build (hashes match hebasto) on both macOS versions, as well as on Windows 11. |
|
Cross-compiling for make -C depends -j13 HOST=x86_64-apple-darwin
gmake: Entering directory '/Users/bitcoin/depends'
Extracting native_qt...
/Users/bitcoin/depends/sources/qtbase-everywhere-src-6.7.3.tar.xz: OK
/Users/bitcoin/depends/sources/qttranslations-everywhere-src-6.7.3.tar.xz: OK
/Users/bitcoin/depends/sources/qttools-everywhere-src-6.7.3.tar.xz: OK
/Users/bitcoin/depends/sources/CMakeLists.txt-6.7.3: OK
/Users/bitcoin/depends/sources/ECMOptionalAddSubdirectory.cmake-6.7.3: OK
/Users/bitcoin/depends/sources/QtTopLevelHelpers.cmake-6.7.3: OK
Preprocessing native_qt...
patching file 'qtbase/configure'
patching file 'qtbase/bin/qt-cmake.in'
patching file 'qtbase/bin/qt-configure-module.in'
patching file 'qtbase/src/tools/moc/main.cpp'
patching file 'qtbase/cmake/QtBaseGlobalTargets.cmake'
patching file 'qtbase/cmake/QtBaseGlobalTargets.cmake'
patching file 'qtbase/src/CMakeLists.txt'
patching file 'qtbase/src/tools/CMakeLists.txt'
patching file 'qtbase/src/tools/rcc/rcc.cpp'
patching file 'qttools/configure.cmake'
patching file 'qttools/src/linguist/CMakeLists.txt'
Configuring native_qt...
opt: pcre val: qt
opt: zlib val: qt
'/opt/homebrew/bin/cmake' '-DCMAKE_EXE_LINKER_FLAGS=' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DBUILD_SHARED_LIBS=OFF' '-DCMAKE_INSTALL_PREFIX=/Users/bitcoin/depends/x86_64-apple-darwin' '-DCMAKE_BUILD_TYPE=Release' '-DINPUT_pkg_config=no' '-DINPUT_reduce_relocations=no' '-DINPUT_use_gold_linker_alias=no' '-DINPUT_concurrent=no' '-DINPUT_network=no' '-DINPUT_printsupport=no' '-DINPUT_sql=no' '-DINPUT_testlib=no' '-DINPUT_xml=no' '-DINPUT_gui=no' '-DINPUT_widgets=no' '-DINPUT_glib=no' '-DINPUT_icu=no' '-DINPUT_libudev=no' '-DINPUT_openssl=no' '-DINPUT_zstd=no' '-DINPUT_pcre=qt' '-DINPUT_system_zlib=no' '-DINPUT_backtrace=no' '-DINPUT_permissions=no' '-DINPUT_process=no' '-DINPUT_settings=no' '-DINPUT_androiddeployqt=no' '-DINPUT_macdeployqt=no' '-DINPUT_windeployqt=no' '-DINPUT_qmake=no' '-DINPUT_linguist=yes' '-DINPUT_assistant=no' '-DINPUT_clang=no' '-DINPUT_clangcpp=no' '-DINPUT_designer=no' '-DINPUT_pixeltool=no' '-DINPUT_qdoc=no' '-DINPUT_qtattributionsscanner=no' '-DINPUT_qtdiag=no' '-DINPUT_qtplugininfo=no' '-G' 'Ninja' '/Users/bitcoin/depends/work/build/x86_64-apple-darwin/native_qt/6.7.3-17d11178efa'
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- The C compiler identification is AppleClang 17.0.0.17000013
-- The ASM compiler identification is AppleClang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/clang
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking dependencies of submodule 'qtbase'
-- Checking dependencies of submodule 'qtactiveqt'
-- Checking dependencies of submodule 'qtdeclarative'
-- Checking dependencies of submodule 'qttools'
-- Skipping optional dependency 'qtactiveqt' of 'qttools', because qtactiveqt's CMakeLists.txt couldn't be found.
-- Skipping optional dependency 'qtdeclarative' of 'qttools', because qtdeclarative's CMakeLists.txt couldn't be found.
-- Checking dependencies of submodule 'qttranslations'
-- Configuring submodule 'qtbase'
-- [QtBase] CMAKE_BUILD_TYPE was already explicitly set to: 'Release'
CMake Warning at qtbase/cmake/QtPublicAppleHelpers.cmake:920 (message):
Qt requires at least version 14 of Xcode, you're building against version .
Please upgrade. You can turn this warning into an error by configuring
with -DQT_FORCE_FATAL_APPLE_SDK_AND_XCODE_CHECK=ON.
Call Stack (most recent call first):
qtbase/cmake/QtBuildHelpers.cmake:443 (_qt_internal_check_apple_sdk_and_xcode_versions)
qtbase/cmake/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables)
qtbase/cmake/QtSetup.cmake:6 (include)
qtbase/cmake/QtBuildRepoHelpers.cmake:21 (include)
qtbase/cmake/QtBuildRepoHelpers.cmake:179 (qt_build_internals_set_up_private_api)
qtbase/cmake/QtBaseHelpers.cmake:154 (qt_build_repo_begin)
qtbase/CMakeLists.txt:32 (qt_internal_qtbase_build_repo)
CMake Warning at qtbase/cmake/QtPublicAppleHelpers.cmake:934 (message):
Qt has only been tested with version 14 of the platform SDK, you're using
15.4. This is an unsupported configuration. You may experience build
issues, and by using the 15.4 SDK you are opting in to new features that Qt
has not been prepared for. Please downgrade the SDK you use to build your
app to version 14, or configure with -DQT_NO_APPLE_SDK_MAX_VERSION_CHECK=ON
to silence this warning.
Call Stack (most recent call first):
qtbase/cmake/QtBuildHelpers.cmake:443 (_qt_internal_check_apple_sdk_and_xcode_versions)
qtbase/cmake/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables)
qtbase/cmake/QtSetup.cmake:6 (include)
qtbase/cmake/QtBuildRepoHelpers.cmake:21 (include)
qtbase/cmake/QtBuildRepoHelpers.cmake:179 (qt_build_internals_set_up_private_api)
qtbase/cmake/QtBaseHelpers.cmake:154 (qt_build_repo_begin)
qtbase/CMakeLists.txt:32 (qt_internal_qtbase_build_repo)
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestOBJCCompiler.cmake:64 (message):
The Objective-C compiler
"/Library/Developer/CommandLineTools/usr/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/Users/bitcoin/depends/work/build/x86_64-apple-darwin/native_qt/6.7.3-17d11178efa/CMakeFiles/CMakeScratch/TryCompile-e5ZtEf'
Run Build Command(s): /opt/homebrew/bin/ninja -v cmTC_2d8d0
[1/2] /Library/Developer/CommandLineTools/usr/bin/clang -x objective-c -arch arm64 -mmacosx-version-min=11.0 -fPIE -MD -MT CMakeFiles/cmTC_2d8d0.dir/testObjCCompiler.m.o -MF CMakeFiles/cmTC_2d8d0.dir/testObjCCompiler.m.o.d -o CMakeFiles/cmTC_2d8d0.dir/testObjCCompiler.m.o -c /Users/bitcoin/depends/work/build/x86_64-apple-darwin/native_qt/6.7.3-17d11178efa/CMakeFiles/CMakeScratch/TryCompile-e5ZtEf/testObjCCompiler.m
[2/2] : && /Library/Developer/CommandLineTools/usr/bin/clang -arch arm64 -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_2d8d0.dir/testObjCCompiler.m.o -o cmTC_2d8d0 && :
FAILED: cmTC_2d8d0
: && /Library/Developer/CommandLineTools/usr/bin/clang -arch arm64 -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_2d8d0.dir/testObjCCompiler.m.o -o cmTC_2d8d0 && :
ld: library 'System' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
qtbase/cmake/QtBuildRepoHelpers.cmake:95 (enable_language)
qtbase/cmake/QtBuildRepoHelpers.cmake:197 (qt_enable_cmake_languages)
qtbase/cmake/QtBaseHelpers.cmake:154 (qt_build_repo_begin)
qtbase/CMakeLists.txt:32 (qt_internal_qtbase_build_repo)
-- Configuring incomplete, errors occurred!
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1077 (message):
CMake exited with code 1.Maybe this can be fixed in a followup. |
Let's leave it for a follow-up. I'll look into it. |
|
Guix Build (x86_64) 05fb54ea0a50b90b3a9f85a0fd92220eb5e0b8e4ac02b41b4adcd7afa329714a guix-build-f00345727b8d/output/aarch64-linux-gnu/SHA256SUMS.part
21dbfba0c1ba24e377e744d95b7b7818f7facd2ae06a4e999cdd707d7b6ca1c7 guix-build-f00345727b8d/output/aarch64-linux-gnu/bitcoin-f00345727b8d-aarch64-linux-gnu-debug.tar.gz
ce1633a6d83dd69a00404d7940e5a39d429ba542df70d02dc4be57be2100d656 guix-build-f00345727b8d/output/aarch64-linux-gnu/bitcoin-f00345727b8d-aarch64-linux-gnu.tar.gz
5b191104e4f907da54fd5dc60717caa33669b81fa5f3bbc0d02ae35c6c4c6724 guix-build-f00345727b8d/output/arm-linux-gnueabihf/SHA256SUMS.part
04d194bafc7781016eb94d559a7bb4383d42d6a09c6de8735f22412d3d4a9cef guix-build-f00345727b8d/output/arm-linux-gnueabihf/bitcoin-f00345727b8d-arm-linux-gnueabihf-debug.tar.gz
02b59e9c3d5071eae74eab7be221c5fd9bc22ec6ac04366337fbe083da60ae92 guix-build-f00345727b8d/output/arm-linux-gnueabihf/bitcoin-f00345727b8d-arm-linux-gnueabihf.tar.gz
8d4e08374040a542ac4e4f888109c96aa5bd32a0044ada0fe15b1663b351e69d guix-build-f00345727b8d/output/arm64-apple-darwin/SHA256SUMS.part
1424aeb9bbbb99805007df96392f8c6f1174168a956b78161fe1f6f8d63e6c51 guix-build-f00345727b8d/output/arm64-apple-darwin/bitcoin-f00345727b8d-arm64-apple-darwin-codesigning.tar.gz
4069174073836bb0a5f463b54071f75420909e50452cbe1a475844aa6db90d10 guix-build-f00345727b8d/output/arm64-apple-darwin/bitcoin-f00345727b8d-arm64-apple-darwin-unsigned.tar.gz
9f3d683edc3d3b33419ee73139fd3ffb5cae64e2101b4558640a6a07e1669a93 guix-build-f00345727b8d/output/arm64-apple-darwin/bitcoin-f00345727b8d-arm64-apple-darwin-unsigned.zip
082b4dceb4fbea4710684b7f22e98b1da56d13f4d060423dfb18b11977e402ac guix-build-f00345727b8d/output/dist-archive/bitcoin-f00345727b8d.tar.gz
6169015f4c40450fdc59e9396542d661055bb9f68c8ecda1e98157eca6638f66 guix-build-f00345727b8d/output/powerpc64-linux-gnu/SHA256SUMS.part
aeff717f9d44e77994f404d0231b587c4928c23dd16dab166492dcf837ed8de7 guix-build-f00345727b8d/output/powerpc64-linux-gnu/bitcoin-f00345727b8d-powerpc64-linux-gnu-debug.tar.gz
73fe630e8d59ff6d9c6871158672fd1e4997c777dab468f14a4bc794f0361252 guix-build-f00345727b8d/output/powerpc64-linux-gnu/bitcoin-f00345727b8d-powerpc64-linux-gnu.tar.gz
a7cceec23bb89873a6362bdc63d949968683081d0bead72b72f602b6bc63e812 guix-build-f00345727b8d/output/riscv64-linux-gnu/SHA256SUMS.part
1e89111bfe7d563636f9bcd97bfaab79cd6004ea9765c5846e13570487d0a5d2 guix-build-f00345727b8d/output/riscv64-linux-gnu/bitcoin-f00345727b8d-riscv64-linux-gnu-debug.tar.gz
5772b7935a2fbda8c2db196eaa1a8c796cbe374850a22de8def2f2f3fb040b1b guix-build-f00345727b8d/output/riscv64-linux-gnu/bitcoin-f00345727b8d-riscv64-linux-gnu.tar.gz
91fd5394065d327a40706239964cbec7e5f0b86be3d8d061e46c3300369ed5f0 guix-build-f00345727b8d/output/x86_64-apple-darwin/SHA256SUMS.part
a164ca87d3f5c3b1207e2aa5c1e1a3368edf4c33e34ee62fa3e33ee50b034ecc guix-build-f00345727b8d/output/x86_64-apple-darwin/bitcoin-f00345727b8d-x86_64-apple-darwin-codesigning.tar.gz
dba87aadf35d8f6ab8378ea600ae8e38f7eb734cb53ee093684d198ee16228ba guix-build-f00345727b8d/output/x86_64-apple-darwin/bitcoin-f00345727b8d-x86_64-apple-darwin-unsigned.tar.gz
d70738e6f86fc2315c0c23a0d3a8d1af24ef85eaeb204a5d921dd75ac8d6e581 guix-build-f00345727b8d/output/x86_64-apple-darwin/bitcoin-f00345727b8d-x86_64-apple-darwin-unsigned.zip
f0688d7cb4990d71071d68b0b13ecc0f06cc8bd39610a451907b070df2ebe4a7 guix-build-f00345727b8d/output/x86_64-linux-gnu/SHA256SUMS.part
38999ffe5eb81e48eec1c869bc3357e5a9b3d9b4f8393243c99b251265e26ab9 guix-build-f00345727b8d/output/x86_64-linux-gnu/bitcoin-f00345727b8d-x86_64-linux-gnu-debug.tar.gz
979e95af7532386a42ee785537a603893c0d8397d999a6af31b5e86fb6b92fac guix-build-f00345727b8d/output/x86_64-linux-gnu/bitcoin-f00345727b8d-x86_64-linux-gnu.tar.gz
2f7ed7f84b5fb3c376085645526be25fb6978a4ca7ce8c0593b17e70ee5128c0 guix-build-f00345727b8d/output/x86_64-w64-mingw32/SHA256SUMS.part
17bd5017a31317d740019e6e738cde329a3f669e147056f933b277222e54792f guix-build-f00345727b8d/output/x86_64-w64-mingw32/bitcoin-f00345727b8d-win64-codesigning.tar.gz
0779c38c7ef398c0060e909932f6c059796e6eec4689e90d3b89c4d5d96847c4 guix-build-f00345727b8d/output/x86_64-w64-mingw32/bitcoin-f00345727b8d-win64-debug.zip
a00a783f76ca4c372ace19ad51cd66cfd3a0eb92143ffed0977be9c6c2928782 guix-build-f00345727b8d/output/x86_64-w64-mingw32/bitcoin-f00345727b8d-win64-setup-unsigned.exe
187aeca6ea896f7e30ce7e3b5c8bdacb2c88c894e379d439acb4be47d100c53a guix-build-f00345727b8d/output/x86_64-w64-mingw32/bitcoin-f00345727b8d-win64-unsigned.zip |
Fixed in #32215. |
|
It would be nice to have a proof of concept (with a diff and CI result) that the gui still works in snap (https://github.com/bitcoin-core/packaging/blob/main/snap/snapcraft.yaml) and flatpak (https://github.com/flathub/org.bitcoincore.bitcoin-qt). Obviously, there is no rush, but the earlier it is known to work, the less risk there is that the 0.30 release later this year will be blocked/delayed for those two package managers. |
|
We might want to add to the release notes that this change effectively enables dark mode support on Windows. |
The currently used Qt 5.15 is approaching EOL and will reach it before the Bitcoin Core v30 release. The recent migration of the 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-cursor0package is required to be installed at runtime.2. Windows
Cross-compiling does not support LTO. We have to re-add it in a follow-up.
A new style plugin causes minor visual glitches, such as

which will be fixed in follow-ups.
3. macOS
bitcoin-qtnow 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.
UPD 2025-03-18: Standard support for Qt 5.15 will end after 26th of May 2025