From: Otto Moerbeek Date: Fri, 6 Sep 2024 14:12:47 +0000 (+0200) Subject: Move minmial boost version to 1.54 X-Git-Tag: rec-5.2.0-alpha1~90^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=690c82f0ecc93285d754e979d107c1028dbe68b2;p=thirdparty%2Fpdns.git Move minmial boost version to 1.54 --- diff --git a/configure.ac b/configure.ac index 93a4e8cee7..011b5a7ec6 100644 --- a/configure.ac +++ b/configure.ac @@ -114,13 +114,7 @@ PDNS_ENABLE_IPCIPHER PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com]) PDNS_CHECK_CLOCK_GETTIME -BOOST_REQUIRE([1.42]) -# Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ -# to be compatible with C++11 -AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148]) -AS_IF([test "$boost_major_version" -ge 148], [ - AC_DEFINE(HAVE_BOOST_GE_148, [1], [Define to 1 if you have boost >= 1.48]) -]) +BOOST_REQUIRE([1.54]) BOOST_PROGRAM_OPTIONS([mt]) AS_IF([test "$boost_cv_lib_program_options" = "no"], [ diff --git a/docs/Makefile.am b/docs/Makefile.am index f9dab778a6..f66969b91a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -36,10 +36,8 @@ MANPAGES_DIST += $(MANPAGES_TARGET_TOOLS) \ dnsbulktest.1 \ dnstcpbench.1 -if HAVE_BOOST_GE_148 MANPAGES_INSTALL += dnsbulktest.1 \ dnstcpbench.1 -endif if TOOLS MANPAGES_INSTALL += $(MANPAGES_TARGET_TOOLS) diff --git a/docs/appendices/compiling.rst b/docs/appendices/compiling.rst index 6d165b4a1f..97fda12ff0 100644 --- a/docs/appendices/compiling.rst +++ b/docs/appendices/compiling.rst @@ -42,7 +42,7 @@ Furthermore, the Makefiles require GNU make, not BSD make. By default, the PowerDNS Authoritative Server requires the following libraries and headers: -* `Boost `_ 1.35 or newer +* `Boost `_ 1.54 or newer * `OpenSSL `_ To build from a Git repository clone, the following dependencies are also required: diff --git a/meson.build b/meson.build index 0b426d1875..65598a86ad 100644 --- a/meson.build +++ b/meson.build @@ -805,6 +805,14 @@ if get_option('tools') 'main': src_dir / 'ixplore.cc', 'manpages': ['ixplore.1'], }, + 'dnstcpbench': { + 'main': src_dir / 'dnstcpbench.cc', + 'manpages': ['dnstcpbench.1'], + }, + 'dnsbulktest': { + 'main': src_dir / 'dnsbulktest.cc', + 'manpages': ['dnsbulktest.1'], + }, # Broken # 'comfun' : { # 'main': src_dir / 'comfun.cc', @@ -833,18 +841,6 @@ if get_option('tools') src_dir / 'tcpiohandler.hh', ) - if have_boost_1_48_0 - tools += { - 'dnstcpbench': { - 'main': src_dir / 'dnstcpbench.cc', - 'manpages': ['dnstcpbench.1'], - }, - 'dnsbulktest': { - 'main': src_dir / 'dnsbulktest.cc', - 'manpages': ['dnsbulktest.1'], - }, - } - endif endif if get_option('tools-ixfrdist') diff --git a/meson/boost/meson.build b/meson/boost/meson.build index 943f0c4d80..76e97576bb 100644 --- a/meson/boost/meson.build +++ b/meson/boost/meson.build @@ -1,8 +1,4 @@ -dep_boost = dependency('boost', version: '>= 1.42', required: true) -# Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ to be compatible -# with C++11. -have_boost_1_48_0 = dep_boost.version().version_compare('>= 1.48.0') -conf.set('HAVE_BOOST_GE_148', have_boost_1_48_0, description: 'Boost version >= 1.48.0') +dep_boost = dependency('boost', version: '>= 1.54', required: true) # conf.set('BOOST_CONTAINER_USE_STD_EXCEPTIONS', true, description: 'Boost use std exceptions') add_project_arguments('-DBOOST_CONTAINER_USE_STD_EXCEPTIONS', language: ['c', 'cpp']) summary('Boost', dep_boost.found(), bool_yn: true, section: 'Boost') diff --git a/pdns/Makefile.am b/pdns/Makefile.am index bee1d58ef0..2522839a0f 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -145,11 +145,9 @@ bin_PROGRAMS += \ bin_PROGRAMS += calidns -if HAVE_BOOST_GE_148 bin_PROGRAMS += \ dnsbulktest \ dnstcpbench -endif endif # TOOLS @@ -1533,13 +1531,8 @@ noinst_PROGRAMS = speedtest if UNIT_TESTS noinst_PROGRAMS += testrunner -if HAVE_BOOST_GE_148 TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message BOOST_TEST_RANDOM=1 SRCDIR='$(srcdir)' TESTS=testrunner -else -check-local: - @echo "Unit tests disabled, boost is too old" -endif else check-local: diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 3ae9a5f98f..aa1892f4c1 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -39,7 +39,7 @@ PDNS_CHECK_PTHREAD_NP PDNS_CHECK_SECURE_MEMSET AC_FUNC_STRERROR_R -BOOST_REQUIRE([1.42]) +BOOST_REQUIRE([1.54]) PDNS_ENABLE_UNIT_TESTS PDNS_ENABLE_FUZZ_TARGETS diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index 9322c392bf..3495034bf0 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -23,10 +23,8 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef HAVE_BOOST_GE_148 -#include "histog.hh" -#endif +#include "histog.hh" #include "statbag.hh" #include "dnspcap.hh" #include "dnsparser.hh" @@ -139,10 +137,8 @@ try ("rd", po::value(), "If set to true, only process RD packets, to false only non-RD, unset: both") ("ipv4", po::value()->default_value(true), "Process IPv4 packets") ("ipv6", po::value()->default_value(true), "Process IPv6 packets") -#ifdef HAVE_BOOST_GE_148 ("log-histogram", "Write a log-histogram to file 'log-histogram'") ("full-histogram", po::value(), "Write a log-histogram to file 'full-histogram' with this millisecond bin size") -#endif ("filter-name,f", po::value(), "Do statistics only for queries within this domain") ("load-stats,l", po::value()->default_value(""), "if set, emit per-second load statistics (questions, answers, outstanding)") ("no-servfail-stats", "Don't include servfails in response time stats") @@ -472,7 +468,6 @@ try cout.precision(4); sum=0; -#ifdef HAVE_BOOST_GE_148 if(g_vm.count("log-histogram")) { string fname = g_vm["stats-dir"].as()+"/log-histogram"; ofstream loglog(fname); @@ -489,8 +484,6 @@ try throw runtime_error("Unable to write statistics to "+fname); writeFullHistogramFile(cumul, g_vm["full-histogram"].as(), loglog); } -#endif - sum=0; double lastperc=0, perc=0; diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index cc6f32516f..67ed5c57d1 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -217,11 +217,8 @@ template uint16_t GenericDNSPacketWriter::lookup */ unsigned int bestpos=0; *matchLen=0; -#if BOOST_VERSION >= 105400 - boost::container::static_vector nvect, pvect; -#else - vector nvect, pvect; -#endif + boost::container::static_vector nvect; + boost::container::static_vector pvect; try { for(auto riter= raw.cbegin(); riter < raw.cend(); ) { diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index 43813f2403..bdc9d94ffa 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -51,10 +51,7 @@ AC_FUNC_STRERROR_R PDNS_CHECK_CLOCK_GETTIME -BOOST_REQUIRE([1.42]) - -# Check against flat_set header that requires boost >= 1.48 -BOOST_FIND_HEADER([boost/container/flat_set.hpp], [AC_MSG_NOTICE([boost::container::flat_set not available, will fallback to std::set])]) +BOOST_REQUIRE([1.54]) # Boost Context was introduced in 1.51 (Aug 2012), but there was an immediate # API break in 1.52 (Nov 2012), so we only support that, and later. diff --git a/pdns/recursordist/docs/appendices/compiling.rst b/pdns/recursordist/docs/appendices/compiling.rst index 7827ff2f6a..f9e462b112 100644 --- a/pdns/recursordist/docs/appendices/compiling.rst +++ b/pdns/recursordist/docs/appendices/compiling.rst @@ -36,7 +36,7 @@ Starting with version 5, a Rust compiler is needed. By default, the :program:`Recursor` requires the following libraries and headers: -* `Boost `_ 1.35 or newer +* `Boost `_ 1.54 or newer * `Lua `_ 5.1+ or `LuaJit `_ * `OpenSSL `_ * For :program:`Recursor` version 5 and higher, `cargo `_ version 1.64 or newer. diff --git a/pdns/recursordist/meson.build b/pdns/recursordist/meson.build index b3db25c9b1..1be86449c0 100644 --- a/pdns/recursordist/meson.build +++ b/pdns/recursordist/meson.build @@ -200,7 +200,7 @@ foreach name, info: conditional_sources endif endforeach -conf.set('HAVE_BOOST_CONTAINER_FLAT_SET_HPP', have_boost_1_48_0, description: 'Boost version >= 1.48.0 has boost::container::flat_set') +conf.set('HAVE_BOOST_CONTAINER_FLAT_SET_HPP', true) # Generate config.h config_h = configure_file(configuration: conf, output: 'config.h') diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index e636cf57a8..d550ffdd8c 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -79,11 +79,7 @@ bool g_reusePort{false}; bool g_gettagNeedsEDNSOptions{false}; bool g_useKernelTimestamp; std::atomic g_maxCacheEntries, g_maxPacketCacheEntries; -#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP boost::container::flat_set g_avoidUdpSourcePorts; -#else -std::set g_avoidUdpSourcePorts; -#endif uint16_t g_minUdpSourcePort; uint16_t g_maxUdpSourcePort; double g_balancingFactor; diff --git a/pdns/recursordist/rec-main.hh b/pdns/recursordist/rec-main.hh index 40b75a6a84..4423ffcf8b 100644 --- a/pdns/recursordist/rec-main.hh +++ b/pdns/recursordist/rec-main.hh @@ -43,9 +43,7 @@ #include "nod.hh" #endif /* NOD_ENABLED */ -#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP #include -#endif extern std::shared_ptr g_slogtcpin; extern std::shared_ptr g_slogudpin; @@ -277,11 +275,7 @@ extern thread_local FrameStreamServersInfo t_frameStreamServersInfo; extern thread_local FrameStreamServersInfo t_nodFrameStreamServersInfo; #endif /* HAVE_FSTRM */ -#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP extern boost::container::flat_set g_avoidUdpSourcePorts; -#else -extern std::set g_avoidUdpSourcePorts; -#endif /* without reuseport, all listeners share the same sockets */ typedef vector>> deferredAdd_t;