Skip to content

Add cmake, qt6, and bitcoin core submodule #475

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

Open
wants to merge 29 commits into
base: qt6
Choose a base branch
from

Conversation

pinheadmz
Copy link
Contributor

@pinheadmz pinheadmz commented Jul 11, 2025

This PR rebases the QML GUI code on upstream Bitcoin Core master, updates dependencies and build system, and defines a new organizational model for the project which may eventually lead to a separation of the GUI completely from bitcoin/bitcoin.

Code changes in qml/

Each commit has a link to Qt docs or to a Bitcoin Core PR to explain it. QML code had to be updated to respect API changes and other conflicts:

  • Upstream master bitcoin/bitcoin
  • Qt6

Git submodule

Bitcoin core is now included as a git submodule. This is a cleaner model than forking the bitcoin core repo:

  • Prevent GUI contributors from creating new conflicts with upstream by changing bitcoin core in the forked repo
  • Garuntee that bitcoin core code is not modified, meaning we don't have to run upstream tests
  • Simplifies the build instructions and the repo itself to make it easier for front end contributors

Cmake

Adds a cmake build system on top of the new submodule+qml/ pair. We currently still need to compile upstream qt/ and there is no flag to separate its library from its binary, so the result is that both GUIs will be built, but no command-line daemon, fuzz, tests, or utility binaries:

build/bin
├── bitcoin-core-app
└── bitcoin-qt

Note: I'm going with the title "Bitcoin Core App" from the design community and to make even more clear the separation from bitcoin-qt

CI

I added a very minimal CI to build binaries for macos and ubuntu, and upload the artifacts. This is mainly a "does it build?" test but I have downloaded and run both artifacts locally and they do work, given that the right linked libraries are available. Future work can make those artifacts more easily usable by testers.

Future work

Obviously there is still a lot to do, but I consider these to be the next major steps:

  • GUI tests
  • Tests builds for all supported platforms
  • Extract qt/ from upstream and integrate in this repo
    • Much of that code can probably be abandoned now
    • The build system can be cleaned up and the legacy binary removed from the output
  • Extract Qt depends build from upstream and integrate in this repo
    • After this, the upstream repo will be set up to clear out all GUI code
  • Figure out guix builds, guix attestations, project release process, and overall degree of separation from Bitcoin Core

pinheadmz added 25 commits July 10, 2025 20:38
https://doc.qt.io/qt-6/qtquickcontrols-index.html#versions

"In Qt 6, both the major and minor versions match, and version numbers
may be omitted from imports in QML. If the version is omitted, the
latest version will be used.""

The old version number for this module in particular resulted in
a "not-installed" error
QQueue inherits from QList.

In Qt5 size() returned an int:
  https://doc.qt.io/archives/qt-5.15/qlist.html#size
but in Qt6 size() returns a qtsizetype:
  https://doc.qt.io/qt-6/qlist.html#size
This is setting a property in an Icon which is defined by us in
Icon.qml as a Button with required property color and
    icon.color: root.color.
In Qt6, only declared public properties are accessible from outside
the component. Qt5 was more lenient about this.
See bitcoin-core#430
This code was merged into bitcoin/src in the gui-qml repository but
should have been either been merged upstream into Bitcoin Core
or just implemented in the GUI, which is what we do in this commit.
This is a reversion of
16f77a5
from bitcoin-core#359
which changed code in Bitcoin Core to notify new peers by their type.

That code needs to be either merged upstream to Bitcoin Core or
otherwise worked-around in gui-qml. Since the actual notification from
Bitcoin Core only sends an int of the TOTAL number of connections
(not just OUTBOUND) whatever UI there is to display this number to the
user is probably now labeled incorrectly.
"legacy GUI" comments added to indicate which helper functions
execute the corresponding code in legacy qt/bitcoin.cpp

common::InitConfig was created in
bitcoin/bitcoin#27150
to de-duplicate a lot of this code.

gArgs.GetChainTypeString() was added in
bitcoin/bitcoin#27491
for DEFAULT_SCRIPTCHECK_THREADS
moved from validation.h in bitcoin/bitcoin#26762
I would have preferred to pull in a tagged release but there is no
current release that includes
bitcoin/bitcoin#32814
which fixes a critical when building qt on macos.
@pinheadmz pinheadmz force-pushed the submodule-qt6-cmake branch 2 times, most recently from c2bc9a5 to 4b27183 Compare July 11, 2025 18:09
@pinheadmz pinheadmz force-pushed the submodule-qt6-cmake branch 6 times, most recently from cf2a192 to df83ecf Compare July 12, 2025 21:03
@pinheadmz pinheadmz force-pushed the submodule-qt6-cmake branch from df83ecf to 67423ba Compare July 12, 2025 21:25
@pinheadmz pinheadmz marked this pull request as ready for review July 13, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant