Skip to content

Commit 8e8b46f

Browse files
feat(bitcoin): add support for Bitcoin Core 29.0 and cmake (#2349)
1 parent 5fd4db7 commit 8e8b46f

25 files changed

Lines changed: 307 additions & 148 deletions

.github/workflows/validation.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
outputs:
2121
ci: ${{ steps.filter.outputs.ci }}
2222
dependencies: ${{ steps.filter.outputs.dependencies }}
23+
dependencies-files: ${{ steps.filter.outputs.dependencies_files }}
2324
docker: ${{ steps.filter.outputs.docker }}
2425
docker-files: ${{ steps.filter.outputs.docker_files }}
2526
markdown: ${{ steps.filter.outputs.markdown }}
@@ -426,6 +427,9 @@ jobs:
426427
max-parallel: 8
427428
matrix:
428429
include:
430+
- { container: openSUSE, dockerfile: Dockerfile_opensuse-leap }
431+
- { container: Oracle Linux, dockerfile: Dockerfile_oraclelinux }
432+
- { container: SUSE Enterprise, dockerfile: Dockerfile_sles }
429433
- { container: Gentoo, dockerfile: Dockerfile_gentoo }
430434
- { container: Alpine, dockerfile: Dockerfile_alpine }
431435
- { container: Amazon Linux, dockerfile: Dockerfile_amazonlinux }
@@ -435,12 +439,9 @@ jobs:
435439
- { container: Fedora, dockerfile: Dockerfile_fedora }
436440
- { container: Kali, dockerfile: Dockerfile_kali }
437441
- { container: Manjaro, dockerfile: Dockerfile_manjarolinux }
438-
- { container: Oracle Linux, dockerfile: Dockerfile_oraclelinux }
439442
- { container: Red Hat Enterprise, dockerfile: Dockerfile_redhat-ubi9 }
440443
- { container: Rocky Linux, dockerfile: Dockerfile_rockylinux }
441-
- { container: SUSE Enterprise, dockerfile: Dockerfile_sles }
442444
- { container: Ubuntu, dockerfile: Dockerfile }
443-
- { container: openSUSE Leap, dockerfile: Dockerfile_opensuse-leap }
444445
steps:
445446
- uses: actions/checkout@v5
446447
- name: Check the current OS version
@@ -456,6 +457,8 @@ jobs:
456457
&&
457458
(
458459
matrix.container != 'Gentoo' ||
460+
contains(needs.changes.outputs.dependencies-files, 'build_dependencies_emerge.txt') ||
461+
contains(needs.changes.outputs.dependencies-files, 'runtime_dependencies_emerge.txt') ||
459462
contains(needs.changes.outputs.docker-files, 'Dockerfile_gentoo') ||
460463
(
461464
github.event.action == '' &&

nodebuilder

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,52 @@ compile_bitcoin_from_source()
6767
git clone --branch "v${target_bitcoin_version}" --depth 1 --quiet -c advice.detachedHead=false "${BITCOIN_CORE_REPO}.git" "${COMPILE_DIRECTORY}" 2> /dev/null
6868
cd "${COMPILE_DIRECTORY}"/
6969

70+
log_info 'Configuring the build environment.'
71+
case "${TARGET_OPERATING_SYSTEM}" in
72+
NetBSD)
73+
cmake -B build \
74+
-DCMAKE_C_COMPILER="/usr/pkg/gcc12/bin/gcc" \
75+
-DCMAKE_CXX_COMPILER="/usr/pkg/gcc12/bin/g++" \
76+
> /dev/null 2>&1
77+
;;
78+
gentoo)
79+
cmake -B build \
80+
> /dev/null 2>&1
81+
;;
82+
*)
83+
cmake -B build \
84+
-DBUILD_GUI=ON \
85+
> /dev/null 2>&1
86+
;;
87+
esac
88+
89+
log_info 'Compiling source code. Please wait.'
90+
cmake --build build --parallel "${compile_num_jobs:-${SYS_CORES_PLUS_ONE}}" > /dev/null 2>&1
91+
92+
log_info 'Running compile checks. Please wait.'
93+
ctest --test-dir build --parallel "${compile_num_jobs:-${SYS_CORES_PLUS_ONE}}" > /dev/null 2>&1
94+
95+
log_info "Installing Bitcoin Core ${target_bitcoin_version}."
96+
cmake --install build > /dev/null 2>&1 || sudo cmake --install build > /dev/null
97+
}
98+
99+
# TODO: use make on old releases and cmake on >= 29.0
100+
# shellcheck disable=SC2317
101+
compile_bitcoin_from_source_make()
102+
{
103+
log_info 'Ensuring compile dependencies.'
104+
readonly COMPILE_DIRECTORY="${TEMP_DIRECTORY}/compile_bitcoin"
105+
readonly STDERR_COMPILE_LOG_FILE="${TEMP_DIRECTORY}/stderr_install.log"
106+
install_build_dependencies
107+
108+
log_info 'Downloading Bitcoin source code.'
109+
# shellcheck disable=SC2015
110+
command -v torsocks > /dev/null 2>&1 &&
111+
[ "${TARGET_KERNEL}" != 'Darwin' ] &&
112+
torsocks git clone --branch "v${target_bitcoin_version}" --depth 1 --quiet -c advice.detachedHead=false "${BITCOIN_CORE_REPO}.git" "${COMPILE_DIRECTORY}" 2> /dev/null ||
113+
git clone --branch "v${target_bitcoin_version}" --depth 1 --quiet -c advice.detachedHead=false "${BITCOIN_CORE_REPO}.git" "${COMPILE_DIRECTORY}" 2> /dev/null
114+
cd "${COMPILE_DIRECTORY}"/
115+
70116
log_info 'Analyzing hardware configuration.'
71117
command -v autoreconf > /dev/null 2>&1 ||
72118
throw_error "Build dependencies failed to install. Manually install 'autoconf' and try again."
@@ -879,9 +925,6 @@ install_build_dependencies_dnf()
879925
;;
880926
esac
881927

882-
dnf list installed epel-release > /dev/null 2>&1 ||
883-
sudo dnf --assumeyes install "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_MAJOR_VERSION_ID}.noarch.rpm"
884-
885928
command -v torsocks > /dev/null 2>&1 &&
886929
dependencies=$(torsocks curl --fail --silent --show-error --location --retry 2 "${BUILD_DEPENDENCIES_URL}") ||
887930
dependencies=$(curl --fail --silent --show-error --location --retry 5 "${BUILD_DEPENDENCIES_URL}")
@@ -934,34 +977,21 @@ install_build_dependencies_openbsd()
934977
{
935978
readonly BUILD_DEPENDENCIES_URL="${DEPENDENCIES_BASE_URL}/build_dependencies_openbsd.txt"
936979
command -v torsocks > /dev/null 2>&1 &&
937-
dependencies=$(torsocks curl --fail --silent --show-error --location --retry 2 "${BUILD_DEPENDENCIES_URL}") ||
938-
dependencies=$(curl --fail --silent --show-error --location --retry 5 "${BUILD_DEPENDENCIES_URL}")
980+
dependencies=$(torsocks curl --fail --silent --show-error --location --retry 2 "${BUILD_DEPENDENCIES_URL}" | tr -d '\r') ||
981+
dependencies=$(curl --fail --silent --show-error --location --retry 5 "${BUILD_DEPENDENCIES_URL}" | tr -d '\r')
939982
[ -z "${dependencies:-}" ] && throw_error "The list of dependencies is empty."
940983
for package in ${dependencies}; do
941984
if [ "${package}" = 'sqlite3' ]; then
942985
sudo pkg_add "${package}" > /dev/null
943986
else
944987
package_latest_version="$(pkg_info -Q "${package}" | grep "^${package}\-" | grep -v "${package}\-[A-Za-z0-9]*\-" | sort -V | tail -1)"
945-
[ "${package}" = 'autoconf' ] && autoconf_package_latest_version="${package_latest_version}"
946-
[ "${package}" = 'automake' ] && automake_package_latest_version="${package_latest_version}"
947988
if [ -z "${package_latest_version}" ]; then
948989
throw_error "Package '${package}' was not found in pkg_info."
949990
elif [ "$(echo "${package_latest_version}" | cut -d' ' -f2)" != '(installed)' ]; then
950991
sudo pkg_add "${package_latest_version}" > /dev/null
951992
fi
952993
fi
953994
done
954-
955-
# major-minor version only
956-
AUTOCONF_VERSION="$(echo "${autoconf_package_latest_version}" | cut -d' ' -f1 | cut -d- -f2 | cut -d. -f1,2)" &&
957-
export AUTOCONF_VERSION
958-
AUTOMAKE_VERSION="$(echo "${automake_package_latest_version}" | cut -d' ' -f1 | cut -d- -f2 | cut -d. -f1,2)" &&
959-
export AUTOMAKE_VERSION
960-
961-
[ -f /usr/local/bin/autoconf-2.72 ] &&
962-
sudo ln -s /usr/local/bin/autoconf-2.72 /usr/local/bin/autoconf-2.72p0
963-
[ -f /usr/local/bin/autoreconf-2.72 ] &&
964-
sudo ln -s /usr/local/bin/autoreconf-2.72 /usr/local/bin/autoreconf-2.72p0
965995
}
966996

967997
install_build_dependencies_pacman()
@@ -993,7 +1023,7 @@ install_build_dependencies_zypper()
9931023
dependencies=$(curl --fail --silent --show-error --location --retry 5 "${BUILD_DEPENDENCIES_URL}")
9941024
[ -z "${dependencies:-}" ] && throw_error "The list of dependencies is empty."
9951025
printf '%s\n' "${dependencies}" | tr -d '\r' | xargs sudo zypper --non-interactive --quiet install
996-
export CXX=g++-13
1026+
export CXX='g++-14'
9971027
}
9981028

9991029
install_runtime_dependencies()
@@ -1543,10 +1573,10 @@ readonly VALID_BITCOIN_VERSION_LIST='0.9.5 0.10.0 0.10.1 0.10.2 0.10.3 0.10.4 \
15431573
0.16.3 0.17.0 0.17.0.1 0.17.1 0.17.2 0.18.0 0.18.1 0.19.0 0.19.0.1 0.19.1 \
15441574
0.20.0 0.20.1 0.20.2 0.21.0 0.21.1 0.21.2 22.0 22.1 23.0 23.1 23.2 24.0 \
15451575
24.0.1 24.1 24.2 25.0 25.1 25.2 26.0 26.1 26.2 27.0 27.1 27.2 28.0 28.1 \
1546-
28.2'
1576+
28.2 29.0'
15471577

15481578
# Bump this variable for new Bitcoin Core releases
1549-
target_bitcoin_version='28.2'
1579+
target_bitcoin_version='29.0'
15501580

15511581
# Instantiate the parameter variables
15521582
compile_bitcoin_flag='false'
@@ -1660,7 +1690,8 @@ readonly TARGET_OPERATING_SYSTEM_RELEASE
16601690

16611691
readonly BITCOIN_CORE_REPO='https://github.com/bitcoin/bitcoin'
16621692
readonly NODEBUILDER_REPO='https://github.com/bitcoin-tools/nodebuilder'
1663-
readonly NODEBUILDER_DEPENDENCIES_TAG='v1.12.0'
1693+
# TODO: during next release v2.0.0, change NODEBUILDER_DEPENDENCIES_TAG from master to the release tag
1694+
readonly NODEBUILDER_DEPENDENCIES_TAG='master'
16641695
readonly DEPENDENCIES_BASE_URL="${NODEBUILDER_REPO}/raw/${NODEBUILDER_DEPENDENCIES_TAG}/resources/dependencies"
16651696

16661697
if [ "${TARGET_KERNEL}" = 'NetBSD' ] && is_running_in_ci; then
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
alpine-sdk
2-
autoconf
3-
automake
4-
boost
51
boost-dev
6-
libffi-dev
7-
db-dev
2+
build-base
3+
cmake
84
libevent-dev
9-
libtool
105
libqrencode-dev
6+
linux-headers
7+
pkgconf
8+
python3
119
qt5-qtbase
1210
qt5-qtbase-x11
1311
qt5-qttools-dev
12+
sqlite-dev
1413
zeromq-dev
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
automake
2-
autotools-dev
3-
bsdmainutils
4-
build-essential
5-
gettext
6-
libboost-dev
7-
libevent-dev
8-
libqrencode-dev
9-
libsqlite3-dev
10-
libtool
11-
libzmq5-dev
12-
pkg-config
13-
python3
14-
qtbase5-dev
15-
qttools5-dev
16-
qttools5-dev-tools
17-
qtwayland5
1+
build-essential
2+
cmake
3+
pkgconf
4+
python3
5+
libevent-dev
6+
libboost-dev
7+
libgl-dev
8+
libqrencode-dev
9+
libsqlite3-dev
10+
libzmq3-dev
11+
qtbase5-dev
12+
qttools5-dev
13+
qttools5-dev-tools
14+
qtwayland5
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
automake
2-
boost
3-
gettext
4-
libevent
5-
libtool
6-
pkg-config
7-
qrencode
8-
qt@5
9-
zeromq
1+
boost
2+
libevent
3+
pkgconf
4+
python
5+
qrencode
6+
qt@5
7+
zeromq
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
autoconf
2-
automake
3-
boost-devel
4-
gcc-c++
5-
libevent-devel
6-
libtool
7-
make
8-
python3
9-
qrencode-devel
10-
qt5-qttools-devel
11-
qt5-qtbase-devel
12-
qt5-qtwayland
13-
sqlite-devel
14-
zeromq-devel
1+
boost-devel
2+
cmake
3+
gcc-c++
4+
libevent-devel
5+
make
6+
python3
7+
qrencode-devel
8+
qt5-qtbase-devel
9+
qt5-qttools-devel
10+
qt5-qtwayland
11+
sqlite-devel
12+
zeromq-devel
13+
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
dev-build/automake
2-
dev-build/libtool
3-
dev-build/make
4-
dev-db/sqlite
5-
dev-lang/python
6-
dev-libs/boost
7-
dev-libs/libevent
8-
dev-qt/linguist-tools
9-
dev-qt/qtgui
10-
dev-qt/qtnetwork
11-
dev-qt/qtwidgets
12-
media-gfx/qrencode
13-
net-libs/zeromq
14-
sys-devel/gettext
1+
dev-build/cmake
2+
dev-db/sqlite
3+
dev-lang/python
4+
dev-libs/boost
5+
dev-libs/libevent
6+
media-gfx/qrencode
7+
net-libs/zeromq
8+
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
autoconf
2-
automake
3-
boost-libs
4-
gettext
5-
gmake
6-
libevent
7-
libqrencode
8-
libtool
9-
libzmq4
10-
pkgconf
11-
python3
12-
sqlite3
13-
qt5-buildtools
14-
qt5-gui
15-
qt5-linguisttools
16-
qt5-widgets
1+
boost-libs
2+
cmake
3+
databases/py-sqlite3
4+
git
5+
libevent
6+
libqrencode
7+
libzmq4
8+
net/py-pyzmq
9+
pkgconf
10+
python3
11+
qt5-buildtools
12+
qt5-gui
13+
qt5-linguisttools
14+
qt5-qmake
15+
qt5-testlib
16+
qt5-widgets
17+
sqlite3
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
autoconf
2-
automake
3-
boost-headers
4-
gmake
5-
libevent
6-
libtool
7-
pkg-config
8-
python312
1+
boost-headers
2+
cmake
3+
gcc12
4+
git
5+
libevent
6+
pkg-config
7+
python312
8+
py312-zmq
9+
qrencode
10+
sqlite3
11+
zeromq
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
autoconf
2-
automake
3-
boost
4-
gettext-tools
5-
gmake
6-
libevent
7-
libqrencode
8-
libtool
9-
python
10-
sqlite3
11-
qttools
12-
zeromq
1+
boost
2+
cmake
3+
git
4+
libevent
5+
libqrencode
6+
python
7+
py3-zmq
8+
qttools
9+
sqlite3
10+
zeromq

0 commit comments

Comments
 (0)