Skip to content

Commit 639279e

Browse files
committed
Merge bitcoin/bitcoin#30997: build: Switch to Qt 6
f003457 doc: Update `dependencies.md` for Qt 6 (Hennadii Stepanov) 80b9179 build, msvc: Update `vcpkg.json` for Qt 6 (Hennadii Stepanov) 30dd1f1 ci: Update for Qt 6 (Hennadii Stepanov) 629d292 test: Update sanitizer suppressions for Qt 6 (Hennadii Stepanov) 551e13a guix: Adjust for Qt 6 (Hennadii Stepanov) c3e9bd0 qt: Fix compiling for Windows (Hennadii Stepanov) ab399c4 depends: Add `native_qt` package (Hennadii Stepanov) 248613e depends: Factor out Qt modules' details (Hennadii Stepanov) 0268f52 depends: Introduce customizable `$(package)_patches_path` variables (Hennadii Stepanov) 5e794e6 depends: Bump `qt` package up to 6.7.3 (Hennadii Stepanov) 6d42149 cmake: Require Qt 6 to build GUI (Hennadii Stepanov) Pull request description: The currently used Qt 5.15 is approaching [EOL](https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders) 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-cursor0` package 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 ![image](https://github.com/user-attachments/assets/e06f8685-aa79-49e7-9e61-4d54563f6d04) which will be fixed in follow-ups. ### 3. macOS `bitcoin-qt` now uses the [Metal](https://developer.apple.com/metal/) backend. --- **IMPORTANT.** Don't forget to install [Ninja](https://ninja-build.org/). --- For historical context, please refer to: - bitcoin/bitcoin#20627 - bitcoin/bitcoin#24798 --- UPD 2024-10-09. Qt 6.8 has been [released](https://www.qt.io/blog/qt-6.8-released), but it has some [drawbacks](bitcoin/bitcoin#30997 (comment)) 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](https://www.qt.io/blog/extended-security-maintenance-for-qt-5.15-begins-may-2025) ACKs for top commit: laanwj: re-ACK f003457 hodlinator: re-ACK f003457 Tree-SHA512: 367f722e6c3ea4700b5395871c40b6df8c8062fdc822107090449ea4ae4ad2db75cc53a982a678f4c48ce8f9b2d43ed10e6d23b06165ab78713f161db712d895
2 parents cfa7f70 + f003457 commit 639279e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+762
-653
lines changed

.github/ISSUE_TEMPLATE/good_first_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body:
2828
id: useful-skills
2929
attributes:
3030
label: Useful Skills
31-
description: For example, “`std::thread`”, “Qt5 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”.
31+
description: For example, “`std::thread`”, “Qt6 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”.
3232
value: |
3333
* Compiling Bitcoin Core from source
3434
* Running the C++ unit tests and the Python functional tests

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
7474
- run: |
7575
sudo apt-get update
76-
sudo apt-get install clang ccache build-essential cmake pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
76+
sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
7777
- name: Compile and run tests
7878
run: |
7979
# Run tests on commits after the last merge commit and before the PR head commit
@@ -130,7 +130,7 @@ jobs:
130130
run: |
131131
# A workaround for "The `brew link` step did not complete successfully" error.
132132
brew install --quiet python@3 || brew link --overwrite python@3
133-
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@5 qrencode
133+
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode
134134
135135
- name: Set Ccache directory
136136
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if(BUILD_GUI)
174174
if(BUILD_GUI_TESTS)
175175
list(APPEND qt_components Test)
176176
endif()
177-
find_package(Qt 5.11.3 MODULE REQUIRED
177+
find_package(Qt 6.2 MODULE REQUIRED
178178
COMPONENTS ${qt_components}
179179
)
180180
unset(qt_components)

ci/test/00_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out}
6464
# The folder for previous release binaries.
6565
# This folder exists only on the ci guest, and on the ci host as a volume.
6666
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases}
67-
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake}
67+
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake ninja-build}
6868
export GOAL=${GOAL:-install}
6969
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
7070
export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}

ci/test/00_setup_env_native_asan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
export CONTAINER_NAME=ci_native_asan
2222
export APT_LLVM_V="20"
23-
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qtbase5-dev qttools5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
23+
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qt6-base-dev qt6-tools-dev qt6-l10n-tools libevent-dev libboost-dev libdb5.3++-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
2424
export NO_DEPENDS=1
2525
export GOAL="install"
2626
export BITCOIN_CONFIG="\

ci/test/00_setup_env_native_centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_centos
1010
export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10"
11-
export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake"
11+
export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make ninja-build git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake"
1212
export PIP_PACKAGES="pyzmq"
1313
export DEP_OPTS="DEBUG=1" # Temporarily enable a DEBUG=1 build to check for GCC-bug-117966 regressions. This can be removed once the minimum GCC version is bumped to 12 in the previous releases task, see https://github.com/bitcoin/bitcoin/issues/31436#issuecomment-2530717875
1414
export GOAL="install"

ci/test/00_setup_env_native_tidy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
1010
export CONTAINER_NAME=ci_native_tidy
1111
export TIDY_LLVM_V="19"
1212
export APT_LLVM_V="${TIDY_LLVM_V}"
13-
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
13+
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev libsqlite3-dev libdb++-dev"
1414
export NO_DEPENDS=1
1515
export RUN_UNIT_TESTS=false
1616
export RUN_FUNCTIONAL_TESTS=false

ci/test/01_base_install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ fi
3434

3535
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
3636
bash -c "dnf -y install epel-release"
37-
bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES"
37+
# The ninja-build package is available in the CRB repository.
38+
bash -c "dnf -y --allowerasing --enablerepo crb install $CI_BASE_PACKAGES $PACKAGES"
3839
elif [ "$CI_OS_NAME" != "macos" ]; then
3940
if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then
4041
echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list

cmake/module/FindQt.cmake

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,13 @@ if(CMAKE_HOST_APPLE)
2727
endif()
2828
endif()
2929

30-
# Save CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state.
31-
unset(_qt_find_root_path_mode_library_saved)
32-
if(DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
33-
set(_qt_find_root_path_mode_library_saved ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
34-
endif()
35-
36-
# The Qt config files internally use find_library() calls for all
37-
# dependencies to ensure their availability. In turn, the find_library()
38-
# inspects the well-known locations on the file system; therefore, it must
39-
# be able to find platform-specific system libraries, for example:
40-
# /usr/x86_64-w64-mingw32/lib/libm.a or /usr/arm-linux-gnueabihf/lib/libm.a.
41-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
42-
4330
find_package(Qt${Qt_FIND_VERSION_MAJOR} ${Qt_FIND_VERSION}
4431
COMPONENTS ${Qt_FIND_COMPONENTS}
4532
HINTS ${_qt_homebrew_prefix}
4633
PATH_SUFFIXES Qt${Qt_FIND_VERSION_MAJOR} # Required on OpenBSD systems.
4734
)
4835
unset(_qt_homebrew_prefix)
4936

50-
# Restore CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state.
51-
if(DEFINED _qt_find_root_path_mode_library_saved)
52-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${_qt_find_root_path_mode_library_saved})
53-
unset(_qt_find_root_path_mode_library_saved)
54-
else()
55-
unset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
56-
endif()
57-
5837
include(FindPackageHandleStandardArgs)
5938
find_package_handle_standard_args(Qt
6039
REQUIRED_VARS Qt${Qt_FIND_VERSION_MAJOR}_DIR

contrib/devtools/symbol-check.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
'libfontconfig.so.1', # font support
113113
'libfreetype.so.6', # font parsing
114114
'libdl.so.2', # programming interface to dynamic linker
115+
'libxcb-cursor.so.0',
115116
'libxcb-icccm.so.4',
116117
'libxcb-image.so.0',
117118
'libxcb-shm.so.0',
@@ -146,8 +147,9 @@
146147
'IOSurface', # cross process image/drawing buffers
147148
'libobjc.A.dylib', # Objective-C runtime library
148149
'Metal', # 3D graphics
149-
'Security', # access control and authentication
150150
'QuartzCore', # animation
151+
'Security', # access control and authentication
152+
'UniformTypeIdentifiers', # collection of types that map to MIME and file types
151153
}
152154

153155
PE_ALLOWED_LIBRARIES = {
@@ -158,7 +160,17 @@
158160
'SHELL32.dll', # shell API
159161
'WS2_32.dll', # sockets
160162
# bitcoin-qt only
163+
'api-ms-win-core-synch-l1-2-0.dll', # Synchronization Primitives API
164+
'api-ms-win-core-winrt-l1-1-0.dll', # Windows Runtime API
165+
'api-ms-win-core-winrt-string-l1-1-0.dll', # WinRT String API
166+
'AUTHZ.dll', # Windows Authorization Framework
167+
'comdlg32.dll', # Common Dialog Box Library
168+
'd3d11.dll', # Direct3D 11 API
169+
'd3d12.dll', # Direct3D 12 API
170+
'd3d9.dll', # Direct3D 9 API
161171
'dwmapi.dll', # desktop window manager
172+
'DWrite.dll', # DirectX Typography Services
173+
'dxgi.dll', # DirectX Graphics Infrastructure
162174
'GDI32.dll', # graphics device interface
163175
'IMM32.dll', # input method editor
164176
'NETAPI32.dll', # network management
@@ -171,6 +183,8 @@
171183
'VERSION.dll', # version checking
172184
'WINMM.dll', # WinMM audio API
173185
'WTSAPI32.dll', # Remote Desktop
186+
'SETUPAPI.dll', # Windows Setup API
187+
'SHCORE.dll', # Stream Handler Core
174188
}
175189

176190
def check_version(max_versions, version, arch) -> bool:

0 commit comments

Comments
 (0)