Skip to content

Commit e0367e8

Browse files
committed
Merge bitcoin/bitcoin#24301: build: header-only Boost
5d399f9 build: remove native B2 package (fanquake) 2037a3b build: header-only Boost (fanquake) 39e66e9 build: use header-only Boost unit test (fanquake) Pull request description: This PR converts our Boost usage to header only. We switch from using our last remaining Boost lib (unit test), to using it's header-only implementation (see https://www.boost.org/doc/libs/1_78_0/libs/test/doc/html/boost_test/adv_scenarios/single_header_customizations/multiple_translation_units.html). Also related to #24291. Guix build: ```bash ``` ACKs for top commit: hebasto: re-ACK 5d399f9 MarcoFalke: approach ACK 5d399f9 📞 Tree-SHA512: e60835ee9c11aa941a64679616da2002d6cd86e464895372fafdd42ad6499d7eb1dde6f0013c60adaeb97bd191198430cb158a7a7417b38080dd7106b28e3ba5
2 parents fd25d34 + 5d399f9 commit e0367e8

20 files changed

+19
-288
lines changed

build-aux/m4/ax_boost_unit_test_framework.m4

Lines changed: 0 additions & 137 deletions
This file was deleted.

build_msvc/bitcoin_config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
/* define if external signer support is enabled (requires Boost::Process) */
4848
#define ENABLE_EXTERNAL_SIGNER /**/
4949

50-
/* define if the Boost::Unit_Test_Framework library is available */
51-
#define HAVE_BOOST_UNIT_TEST_FRAMEWORK /**/
52-
5350
/* Define this symbol if the consensus lib has been built */
5451
#define HAVE_CONSENSUS_LIB 1
5552

ci/test/00_setup_env_native_asan.sh

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

99
export CONTAINER_NAME=ci_native_asan
10-
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev"
10+
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev"
1111
export DOCKER_NAME_TAG=ubuntu:22.04
1212
export NO_DEPENDS=1
1313
export GOAL="install"

ci/test/00_setup_env_native_fuzz.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 DOCKER_NAME_TAG="ubuntu:20.04"
1010
export CONTAINER_NAME=ci_native_fuzz
11-
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-test-dev libsqlite3-dev"
11+
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libsqlite3-dev"
1212
export NO_DEPENDS=1
1313
export RUN_UNIT_TESTS=false
1414
export RUN_FUNCTIONAL_TESTS=false

ci/test/00_setup_env_native_fuzz_with_valgrind.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 DOCKER_NAME_TAG="ubuntu:20.04"
1010
export CONTAINER_NAME=ci_native_fuzz_valgrind
11-
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-test-dev libsqlite3-dev valgrind"
11+
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libsqlite3-dev valgrind"
1212
export NO_DEPENDS=1
1313
export RUN_UNIT_TESTS=false
1414
export RUN_FUNCTIONAL_TESTS=false

ci/test/00_setup_env_native_valgrind.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 DOCKER_NAME_TAG="ubuntu:22.04"
1010
export CONTAINER_NAME=ci_native_valgrind
11-
export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
11+
export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
1212
export USE_VALGRIND=1
1313
export NO_DEPENDS=1
1414
export TEST_RUNNER_EXTRA="--nosandbox --exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547

configure.ac

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,6 @@ if test "$use_boost" = "yes"; then
14041404
if test "$suppress_external_warnings" != "no"; then
14051405
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
14061406
fi
1407-
1408-
BOOST_LIBS="$BOOST_LDFLAGS"
14091407
fi
14101408

14111409
if test "$use_external_signer" != "no"; then
@@ -1469,30 +1467,6 @@ if test "$use_tests" = "yes"; then
14691467
if test "$HEXDUMP" = ""; then
14701468
AC_MSG_ERROR([hexdump is required for tests])
14711469
fi
1472-
1473-
if test "$use_boost" = "yes"; then
1474-
1475-
AX_BOOST_UNIT_TEST_FRAMEWORK
1476-
1477-
dnl Determine if -DBOOST_TEST_DYN_LINK is needed
1478-
AC_MSG_CHECKING([for dynamic linked boost test])
1479-
TEMP_LIBS="$LIBS"
1480-
LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
1481-
TEMP_CPPFLAGS="$CPPFLAGS"
1482-
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1483-
AC_LINK_IFELSE([AC_LANG_SOURCE([
1484-
#define BOOST_TEST_DYN_LINK
1485-
#define BOOST_TEST_MAIN
1486-
#include <boost/test/unit_test.hpp>
1487-
1488-
])],
1489-
[AC_MSG_RESULT([yes])]
1490-
[TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
1491-
[AC_MSG_RESULT([no])])
1492-
LIBS="$TEMP_LIBS"
1493-
CPPFLAGS="$TEMP_CPPFLAGS"
1494-
1495-
fi
14961470
fi
14971471

14981472
dnl libevent check
@@ -1866,7 +1840,6 @@ AC_SUBST(USE_BDB)
18661840
AC_SUBST(ENABLE_EXTERNAL_SIGNER)
18671841
AC_SUBST(USE_UPNP)
18681842
AC_SUBST(USE_QRCODE)
1869-
AC_SUBST(BOOST_LIBS)
18701843
AC_SUBST(TESTDEFS)
18711844
AC_SUBST(MINIUPNPC_CPPFLAGS)
18721845
AC_SUBST(MINIUPNPC_LIBS)

depends/packages/boost.mk

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,8 @@ $(package)_version=1.71.0
33
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version)/source/
44
$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.bz2
55
$(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
6-
$(package)_dependencies=native_b2
7-
$(package)_patches=fix_openbsd_test_lib.patch
8-
9-
define $(package)_set_vars
10-
$(package)_config_opts_release=variant=release
11-
$(package)_config_opts_debug=variant=debug
12-
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
13-
$(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1
14-
$(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared
15-
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
16-
$(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static
17-
$(package)_config_opts_x86_64=architecture=x86 address-model=64
18-
$(package)_config_opts_i686=architecture=x86 address-model=32
19-
$(package)_config_opts_aarch64=address-model=64
20-
$(package)_config_opts_armv7a=address-model=32
21-
ifneq (,$(findstring clang,$($(package)_cxx)))
22-
$(package)_toolset_$(host_os)=clang
23-
else
24-
$(package)_toolset_$(host_os)=gcc
25-
endif
26-
$(package)_config_libraries=test
27-
$(package)_cxxflags+=-std=c++17
28-
$(package)_cxxflags_linux=-fPIC
29-
$(package)_cxxflags_freebsd=-fPIC
30-
$(package)_cxxflags_openbsd=-fPIC
31-
$(package)_cxxflags_android=-fPIC
32-
$(package)_cxxflags_x86_64=-fcf-protection=full
33-
endef
34-
35-
define $(package)_preprocess_cmds
36-
patch -p1 < $($(package)_patch_dir)/fix_openbsd_test_lib.patch && \
37-
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cflags>\"$($(package)_cflags)\" <cxxflags>\"$($(package)_cxxflags)\" <compileflags>\"$($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_ar)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
38-
endef
39-
40-
define $(package)_config_cmds
41-
./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os)) --with-bjam=b2
42-
endef
43-
44-
define $(package)_build_cmds
45-
b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage
46-
endef
476

487
define $(package)_stage_cmds
49-
b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) --no-cmake-config install
8+
mkdir -p $($(package)_staging_prefix_dir)/include && \
9+
cp -r boost $($(package)_staging_prefix_dir)/include
5010
endef

depends/packages/native_b2.mk

Lines changed: 0 additions & 20 deletions
This file was deleted.

depends/packages/packages.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ usdt_linux_packages=systemtap
2525

2626
darwin_native_packages = native_ds_store native_mac_alias
2727

28-
$(host_arch)_$(host_os)_native_packages += native_b2
29-
3028
ifneq ($(build_os),darwin)
3129
darwin_native_packages += native_cctools native_libtapi native_libdmg-hfsplus
3230

0 commit comments

Comments
 (0)