Skip to content

build: Upgrade depends to Qt6#231

Open
kwsantiago wants to merge 45 commits intobitcoinknots:29.x-knotsfrom
privkeyio:kwsantiago/qt6-depends-upgrade
Open

build: Upgrade depends to Qt6#231
kwsantiago wants to merge 45 commits intobitcoinknots:29.x-knotsfrom
privkeyio:kwsantiago/qt6-depends-upgrade

Conversation

@kwsantiago
Copy link

@kwsantiago kwsantiago commented Nov 5, 2025

Upgrades the depends system to build Qt 6.7.3, preparing the codebase for Qt6 compatibility.

Changes

  • Add Qt6 (6.7.3) package definitions and patches
  • Update Qt build configuration to support both Qt5 and Qt6
  • Add automatic Qt version detection in depends toolchain
  • Add libxcb_util_cursor package for Qt6 Linux builds
  • Remove obsolete Qt5-specific patches

Details

This PR modernizes the Qt dependency infrastructure without changing application behavior. The Qt6 upgrade provides:

  • Long-term Qt support (Qt5 reaches end-of-life in 2025)
  • Better compatibility with modern platforms
  • Foundation for future Qt6-specific features

@luke-jr
Copy link
Collaborator

luke-jr commented Nov 8, 2025

This shouldn't have the wintaskbar changes - isolate that to the other PR

@kwsantiago kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch from 32ad8cd to a975bc0 Compare November 9, 2025 00:53
@kwsantiago kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch 2 times, most recently from 0b5e2aa to ed0e1fc Compare November 16, 2025 01:34
@kwsantiago kwsantiago marked this pull request as ready for review January 8, 2026 20:37
@luke-jr
Copy link
Collaborator

luke-jr commented Feb 5, 2026

Annoyingly, it looks like Qt does not allow open source projects to use LTS or even stable branches, which forces us to be the guinea pigs... only their latest version (currently 6.10.2) is up to date on fixes.

Which leads me to think we might actually be better off with 5.15. We still have to track security vulnerabilities for it somewhat manually (Qt is still maintaining it commercially), but at least there isn't a constant wave of new features introducing new bugs.

The problem then is that Qt 5 isn't up to par on HiDPI or "dark mode" support. So in the end, Qt 6 is the only real option. :(

But let's try to at least stay close to Core on this for now. I'm expecting a branch to look like this: v29.3.knots20260203rc1...luke-jr:bitcoin:knots-qt6-experiment-20260204

Mind you, that branch does NOT build currently (due to some freetype issue). But it would be a good starting point to remake this with.

luke-jr and others added 21 commits February 16, 2026 15:13
This reverts commit bd4eee5, reversing
changes made to 91f80d5.
This change helps avoid patch duplication between a package and its
native counterpart.

Github-Pull: bitcoin#30997
Rebased-From: 0268f52
Unlike Qt 5, Qt 6 requires a separate native Qt build for
cross-building.

See: https://www.qt.io/blog/qt-6-build-system.

Github-Pull: bitcoin#30997
Rebased-From: ab399c4
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.

Github-Pull: bitcoin#30997
Rebased-From: 551e13a
Github-Pull: bitcoin#30997
Rebased-From: 30dd1f1
Github-Pull: bitcoin#30997
Rebased-From: 6d42149
On older systems, such as Ubuntu 22.04, `qt6-tools-dev-tools` and
`libgl-dev` are not treated as dependencies of `qt6-tools-dev` and
`qt6-base-dev`, respectively. This change explicitly lists them in the
installation documentation.

Github-Pull: bitcoin#32211
Rebased-From: 2e751f5
This change updates the vcpkg manifest baseline from the "2024.09.30
Release" to the "2025.03.19 Release", with the following package
changes:
 - boost: 1.85.0#1,2 --> 1.87.0
 - qtbase: 6.7.2#3 -> 6.8.2#1
 - qttools: 6.7.2#1 -> 6.8.2
 - sqlite3: 3.46.1 --> 3.49.1

Github-Pull: bitcoin#32213
Rebased-From: fe5a6dc
This change makes vcpkg skip unused features such as `dnslookup`,
`openssl`, etc.

Github-Pull: bitcoin#32213
Rebased-From: d85895e
This change fixes cross-compilation from macOS to macOS with another
architecture.

Github-Pull: bitcoin#32215
Rebased-From: 690f5da
Extend `getFrameworks()` with an optional `rpath` parameter to replace
`@rpath` in dependency paths. This fixes resolution of framework
dependencies when using Homebrew's `qt@6` package.

Github-Pull: bitcoin#32287
Rebased-From: 938208d
Homebrew’s `qt@6` package places the `translations` and `plugins`
directories in the `share/qt` subdirectory.
This change updates the `macdeployqtplus` script accordingly.

Github-Pull: bitcoin#32287
Rebased-From: fad57e9
hebasto and others added 18 commits February 16, 2026 15:15
The patches needed to support this were dropped in
5e794e6 and "Cross-compiling does not
support LTO." (from bitcoin#30997), so remove it for now.

Github-Pull: bitcoin#32496
Rebased-From: 9653ebc
Using Clang clang version 20.1.6 (Fedora 20.1.6-9.fc43) and:
```bash
export CC=clang
export CXX=clang++
cmake -B build -DBUILD_GUI=ON -DSANITIZERS=address
cmake --build build
export LSAN_OPTIONS="suppressions=/root/bitcoin/test/sanitizer_suppressions/lsan"
ctest --test-dir build
```

```bash
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1589ms
********* Finished testing of AddressBookTests *********

=================================================================
==21869==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0xaaaab5d5af40 in operator new(unsigned long) (/root/bitcoin/build/bin/test_bitcoin-qt+0x39af40) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
    bitcoinknots#1 0xffff8c8f56cc in QLayoutPrivate::createWidgetItem(QLayout const*, QWidget*) (/lib64/libQt6Widgets.so.6+0x1a56cc) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    bitcoinknots#2 0xffff8c8d2f90 in QBoxLayout::insertWidget(int, QWidget*, int, QFlags<Qt::AlignmentFlag>) (/lib64/libQt6Widgets.so.6+0x182f90) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    bitcoinknots#3 0xaaaab5fc7188 in SendCoinsDialog::addEntry() /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:596:18
    bitcoinknots#4 0xaaaab5fc4eec in SendCoinsDialog::SendCoinsDialog(PlatformStyle const*, QWidget*) /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:84:5
    bitcoinknots#5 0xaaaab5da67ac in (anonymous namespace)::MiniGUI::MiniGUI(interfaces::Node&, PlatformStyle const*) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:235:75
    bitcoinknots#6 0xaaaab5da2000 in (anonymous namespace)::TestGUI(interfaces::Node&, std::shared_ptr<wallet::CWallet> const&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:270:13
    bitcoinknots#7 0xaaaab5d9ebc8 in (anonymous namespace)::TestGUI(interfaces::Node&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:453:5
    bitcoinknots#8 0xaaaab5d9ebc8 in WalletTests::walletTests() /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:475:5
    bitcoinknots#9 0xffff8b1c5314 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195314) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    bitcoinknots#10 0xffff8b1c5dc8 in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195dc8) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    bitcoinknots#11 0xffff8cf57c54  (/lib64/libQt6Test.so.6+0x27c54) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#12 0xffff8cf5fa18  (/lib64/libQt6Test.so.6+0x2fa18) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#13 0xffff8cf6067c  (/lib64/libQt6Test.so.6+0x3067c) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#14 0xffff8cf610a4  (/lib64/libQt6Test.so.6+0x310a4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#15 0xffff8cf61aa4 in QTest::qRun() (/lib64/libQt6Test.so.6+0x31aa4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#16 0xffff8cf61eb4 in QTest::qExec(QObject*, int, char**) (/lib64/libQt6Test.so.6+0x31eb4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoinknots#17 0xaaaab5d7d77c in main /root/bitcoin/build/src/qt/test/./qt/test/test_main.cpp:95:30
    bitcoinknots#18 0xffff8aad6398 in __libc_start_call_main (/lib64/libc.so.6+0x26398) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    bitcoinknots#19 0xffff8aad6478 in __libc_start_main@GLIBC_2.17 (/lib64/libc.so.6+0x26478) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    bitcoinknots#20 0xaaaab5c74cac in _start (/root/bitcoin/build/bin/test_bitcoin-qt+0x2b4cac) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
```

This happens when building using depends:
```bash
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabdbe86f8 in malloc (/root/bitcoin/build/bin/test_bitcoin-qt+0x4386f8) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#1 0xfbff97f8c164  (<unknown module>)
    bitcoinknots#2 0xaaaabf0cfaa4 in QDBusConnectionPrivate::QDBusConnectionPrivate() (/root/bitcoin/build/bin/test_bitcoin-qt+0x191faa4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#3 0xaaaabf0c9e30 in QDBusConnectionManager::doConnectToStandardBus(QDBusConnection::BusType, QString const&, bool) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919e30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#4 0xaaaabf0cb0e4 in QtPrivate::QCallableObject<QDBusConnectionPrivate* (QDBusConnectionManager::*)(QDBusConnection::BusType, QString const&, bool), QtPrivate::List<QDBusConnection::BusType&, QString const&, bool&>, QDBusConnectionPrivate*>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x191b0e4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#5 0xaaaabf5cbaf0 in QObject::event(QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e1baf0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#6 0xaaaabf5a4ce0 in QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df4ce0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#7 0xaaaabf5a486c in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df486c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#8 0xaaaabf5a575c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df575c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#9 0xaaaabf66b858 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1ebb858) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#10 0xaaaabf5a9e3c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df9e3c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#11 0xaaaabf632a44 in QThread::exec() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e82a44) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#12 0xaaaabf0c9bd0 in QDBusConnectionManager::run() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919bd0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#13 0xaaaabf669c30 in QThreadPrivate::start(void*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1eb9c30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    bitcoinknots#14 0xaaaabdbe5f2c in asan_thread_start(void*) asan_interceptors.cpp.o
    bitcoinknots#15 0xffff99538608 in thread_start (/lib64/libc.so.6+0xf8608) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)

SUMMARY: AddressSanitizer: 3592 byte(s) leaked in 37 allocation(s).
```

Github-Pull: bitcoin#32780
Rebased-From: 5be31b2
This is listed on https://doc.qt.io/qt-5.15/linux-requirements.html as
"recommended", however doesn't seem to be needed, and the fact that it's
no-longer installed by default on modern linux distros, is
annoying/confusing for users. See:

bitcoin#30061
https://bitcoin.stackexchange.com/questions/122646/libxcb-xinerama0-library-required-by-bitcoin-qt
bitcoin#33197
bitcoin#32097

Github-Pull: bitcoin#33217
Rebased-From: 3d9314f
Otherwise we end up with ~1.5GB of binaries (Linux) when DEBUG=1..

Github-Pull: bitcoin#33304
Rebased-From: c9d5f21
Modern Ubuntu isn't shipping with this library installed by default.
Staticly link it to remove the need for end-users to install it.

Closes bitcoin#33432.

Github-Pull: bitcoin#33434
Rebased-From: eca5085
Replace the unreliable https://code.qt.io with the GitHub mirror link.

Github-Pull: bitcoin#33918
Rebased-From: 50cbde3
@kwsantiago kwsantiago force-pushed the kwsantiago/qt6-depends-upgrade branch from ed0e1fc to c7365fb Compare February 16, 2026 20:17
@kwsantiago
Copy link
Author

kwsantiago commented Feb 16, 2026

@luke-jr Rebased on your branch. Issue was dbus/wayland, not freetype. Builds now with 6.10.2

- chmod +x CentOS Qt5 CI setup script (lint-files.py)
- add NO_QR=1 to CentOS DEP_OPTS so toolchain sets WITH_QRENCODE=OFF
  (qrencode not built by depends when NO_QT=1)
- add compiler-rt __isPlatformVersionAtLeast shim for macOS cross builds
  (Qt6 Cocoa plugin uses @available() which needs this compiler builtin
  not available when cross-compiling from Linux with clang + lld)
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.

5 participants