aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiminuo <kiminuo@protonmail.com>2020-06-11 10:04:33 +0200
committerfanquake <fanquake@gmail.com>2022-02-03 18:35:52 +0800
commitb87f9c5edf3895df9650131fcf8551c3ad1d7301 (patch)
tree49452ef57938298ccc5f321cd2e7788b295b8b65
parent41d7166c8a598b604aad6c6b1d88ad46e23be247 (diff)
build: remove boost::filesystem usage
-rw-r--r--build-aux/m4/ax_boost_filesystem.m4118
-rw-r--r--build_msvc/bitcoin_config.h.in3
-rw-r--r--build_msvc/vcpkg.json1
-rwxr-xr-xci/test/00_setup_env_native_asan.sh2
-rwxr-xr-xci/test/00_setup_env_native_fuzz.sh2
-rwxr-xr-xci/test/00_setup_env_native_fuzz_with_valgrind.sh2
-rwxr-xr-xci/test/00_setup_env_native_valgrind.sh2
-rw-r--r--configure.ac3
-rw-r--r--contrib/valgrind.supp21
-rw-r--r--depends/packages/boost.mk2
-rw-r--r--doc/build-unix.md2
11 files changed, 7 insertions, 151 deletions
diff --git a/build-aux/m4/ax_boost_filesystem.m4 b/build-aux/m4/ax_boost_filesystem.m4
deleted file mode 100644
index 12f7bc5e2e..0000000000
--- a/build-aux/m4/ax_boost_filesystem.m4
+++ /dev/null
@@ -1,118 +0,0 @@
-# ===========================================================================
-# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_FILESYSTEM
-#
-# DESCRIPTION
-#
-# Test for Filesystem library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_FILESYSTEM_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_FILESYSTEM
-#
-# LICENSE
-#
-# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2009 Michael Tindal
-# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 28
-
-AC_DEFUN([AX_BOOST_FILESYSTEM],
-[
- AC_ARG_WITH([boost-filesystem],
- AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
- [use the Filesystem library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_filesystem_lib=""
- else
- want_boost="yes"
- ax_boost_user_filesystem_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- LIBS_SAVED=$LIBS
- LIBS="$LIBS $BOOST_SYSTEM_LIB"
- export LIBS
-
- AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
- ax_cv_boost_filesystem,
- [AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
- [[using namespace boost::filesystem;
- path my_path( "foo/bar/data.txt" );
- return 0;]])],
- ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_filesystem" = "xyes"; then
- AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
- if test "x$ax_boost_user_filesystem_lib" = "x"; then
- for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
- if test "x$link_filesystem" != "xyes"; then
- for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
- fi
- else
- for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
- [link_filesystem="no"])
- done
-
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the Boost::Filesystem library!)
- fi
- if test "x$link_filesystem" != "xyes"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- LIBS="$LIBS_SAVED"
- fi
-])
diff --git a/build_msvc/bitcoin_config.h.in b/build_msvc/bitcoin_config.h.in
index 83e53c8d56..856982ef93 100644
--- a/build_msvc/bitcoin_config.h.in
+++ b/build_msvc/bitcoin_config.h.in
@@ -44,9 +44,6 @@
/* define if the Boost library is available */
#define HAVE_BOOST /**/
-/* define if the Boost::Filesystem library is available */
-#define HAVE_BOOST_FILESYSTEM /**/
-
/* define if external signer support is enabled (requires Boost::Process) */
#define ENABLE_EXTERNAL_SIGNER /**/
diff --git a/build_msvc/vcpkg.json b/build_msvc/vcpkg.json
index 42b9a5d16f..d8753ec21f 100644
--- a/build_msvc/vcpkg.json
+++ b/build_msvc/vcpkg.json
@@ -3,7 +3,6 @@
"version-string": "1",
"dependencies": [
"berkeleydb",
- "boost-filesystem",
"boost-multi-index",
"boost-process",
"boost-signals2",
diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh
index 109b121466..a53102d943 100755
--- a/ci/test/00_setup_env_native_asan.sh
+++ b/ci/test/00_setup_env_native_asan.sh
@@ -7,7 +7,7 @@
export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_asan
-export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev"
+export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev"
export DOCKER_NAME_TAG=ubuntu:22.04
export NO_DEPENDS=1
export GOAL="install"
diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh
index 34b25438a4..bb21bba7a9 100755
--- a/ci/test/00_setup_env_native_fuzz.sh
+++ b/ci/test/00_setup_env_native_fuzz.sh
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export DOCKER_NAME_TAG="ubuntu:20.04"
export CONTAINER_NAME=ci_native_fuzz
-export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libsqlite3-dev"
+export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-test-dev libsqlite3-dev"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh
index fe6df0cbb7..3fc3782c1c 100755
--- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh
+++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export DOCKER_NAME_TAG="ubuntu:20.04"
export CONTAINER_NAME=ci_native_fuzz_valgrind
-export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libsqlite3-dev valgrind"
+export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-test-dev libsqlite3-dev valgrind"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh
index e414385cc4..81c396ad67 100755
--- a/ci/test/00_setup_env_native_valgrind.sh
+++ b/ci/test/00_setup_env_native_valgrind.sh
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export DOCKER_NAME_TAG="ubuntu:20.04"
export CONTAINER_NAME=ci_native_valgrind
-export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
+export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-dev libboost-system-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
export USE_VALGRIND=1
export NO_DEPENDS=1
export TEST_RUNNER_EXTRA="--nosandbox --exclude rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
diff --git a/configure.ac b/configure.ac
index 5db104f0d6..adefbbc2f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1408,13 +1408,12 @@ if test "$use_boost" = "yes"; then
AC_MSG_ERROR([only libbitcoinconsensus can be built without Boost])
fi
AX_BOOST_SYSTEM
- AX_BOOST_FILESYSTEM
if test "$suppress_external_warnings" != "no"; then
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
fi
- BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB"
+ BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB"
fi
if test "$use_external_signer" != "no"; then
diff --git a/contrib/valgrind.supp b/contrib/valgrind.supp
index ece02dc24e..35f3d792ff 100644
--- a/contrib/valgrind.supp
+++ b/contrib/valgrind.supp
@@ -119,12 +119,6 @@
fun:wcsnrtombs
}
{
- Suppress wcsnrtombs warning (remove after removing boost::fs)
- Memcheck:Cond
- ...
- fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE
-}
-{
Suppress boost warning
Memcheck:Leak
fun:_Znwm
@@ -135,21 +129,6 @@
fun:main
}
{
- Suppress boost::filesystem warning (fixed in boost 1.70: https://github.com/boostorg/filesystem/commit/bbe9d1771e5d679b3f10c42a58fc81f7e8c024a9)
- Memcheck:Cond
- fun:_ZN5boost10filesystem6detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE
- ...
- obj:*/libboost_filesystem.so.*
-}
-{
- Suppress boost::filesystem warning (could be related: https://stackoverflow.com/questions/9830182/function-boostfilesystemcomplete-being-reported-as-possible-memory-leak-by-v)
- Memcheck:Leak
- match-leak-kinds: reachable
- fun:_Znwm
- ...
- fun:_ZN5boost10filesystem8absoluteERKNS0_4pathES3_
-}
-{
Suppress boost still reachable memory warning
Memcheck:Leak
match-leak-kinds: reachable
diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk
index 9d3ba321f9..8509c92de8 100644
--- a/depends/packages/boost.mk
+++ b/depends/packages/boost.mk
@@ -22,7 +22,7 @@ $(package)_toolset_$(host_os)=clang
else
$(package)_toolset_$(host_os)=gcc
endif
-$(package)_config_libraries=filesystem,system,test
+$(package)_config_libraries=system,test
$(package)_cxxflags+=-std=c++17
$(package)_cxxflags_linux=-fPIC
$(package)_cxxflags_freebsd=-fPIC
diff --git a/doc/build-unix.md b/doc/build-unix.md
index f50a9b23c0..c1da10b316 100644
--- a/doc/build-unix.md
+++ b/doc/build-unix.md
@@ -82,7 +82,7 @@ Build requirements:
Now, you can either build from self-compiled [depends](/depends/README.md) or install the required dependencies:
- sudo apt-get install libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev
+ sudo apt-get install libevent-dev libboost-dev libboost-system-dev libboost-test-dev
SQLite is required for the descriptor wallet: