From 31d7e54b1ac247575c67449cec50bc45e1c0cc2d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 19 Aug 2023 23:51:57 +0800 Subject: [PATCH 1/7] Add patch for Boost.Accumulators bug This change silences the warning when compiling Boost.accumulators with GCC 13. as some projects using Boost.Accumulators are compiled with -Werror. Without this change, these project would have to disable -Wuninitialized warning or silence it temporarily when including the offending headers. Neither of these two solution is ideal from a developer's perspective. so let's apply the patch when packaging Boost. The patch was included by Boost 1.83. Signed-off-by: Kefu Chai --- ....0-always-initialize-member-variable.patch | 41 +++++++++++++++++++ boost.spec | 9 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 boost-1.81.0-always-initialize-member-variable.patch diff --git a/boost-1.81.0-always-initialize-member-variable.patch b/boost-1.81.0-always-initialize-member-variable.patch new file mode 100644 index 0000000..14c48ae --- /dev/null +++ b/boost-1.81.0-always-initialize-member-variable.patch @@ -0,0 +1,41 @@ +From ecdc3d41be93d994cf293b6ce08cc33cb9e39e71 Mon Sep 17 00:00:00 2001 +From: Kefu Chai +Date: Thu, 27 Apr 2023 13:09:28 +0800 +Subject: [PATCH] always initialize member variable + +in this change, impl::extended_p_square_quantile_impl::probability is +zero-initialized to silence -Wuninitialized warning from GCC-13. + +despite that this variable is always initialized in +impl::extended_p_square_quantile_impl::result(), it is still referenced +by, for instance the copy constructor, which could be called before +`result()` gets called. and GCC-13 rightly warn us like: + +In copy constructor ‘constexpr boost::accumulators::impl::extended_p_square_quantile_impl::extended_p_square_quantile_impl(const boost::accumulators::impl::extended_p_square_quantile_impl&)’, + inlined from ‘boost::accumulators::detail::accumulator_wrapper::accumulator_wrapper(const boost::accumulators::detail::accumulator_wrapper&) [with Accumulator = boost::accumulators::impl::extended_p_square_quantile_impl; Feature = boost::accumulators::tag::extended_p_square_quantile_quadratic]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:320:69, + inlined from ‘constexpr boost::fusion::cons::cons(typename boost::fusion::detail::call_param::type, typename boost::fusion::detail::call_param::type) [with Car = boost::accumulators::detail::accumulator_wrapper, boost::accumulators::tag::extended_p_square_quantile_quadratic>; Cdr = boost::fusion::cons, boost::accumulators::tag::sum>, boost::fusion::cons, boost::accumulators::tag::mean>, boost::fusion::cons, boost::accumulators::tag::max>, boost::fusion::nil_> > >]’ at /usr/include/boost/fusion/container/list/cons.hpp:66:15, + inlined from ‘static boost::accumulators::detail::build_acc_list::type boost::accumulators::detail::build_acc_list::call(const Args&, const First&, const Last&) [with Args = boost::parameter::aux::flat_like_arg_list, void> >, std::integral_constant >, boost::parameter::aux::flat_like_arg_tuple, boost::parameter::aux::tagged_argument, std::array >, std::integral_constant > >; First = boost::fusion::mpl_iterator, boost::accumulators::tag::max>, boost::mpl::v_item, boost::accumulators::tag::mean>, boost::mpl::v_item, boost::accumulators::tag::sum>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item, boost::mpl::vector0, 0>, 0>, 0>, 0>, 0>, 0>, 2> >; Last = boost::fusion::mpl_iterator, boost::accumulators::tag::max>, boost::mpl::v_item, boost::accumulators::tag::mean>, boost::mpl::v_item, boost::accumulators::tag::sum>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item, boost::mpl::vector0, 0>, 0>, 0>, 0>, 0>, 0>, 6> >]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:252:86, + inlined from ‘static boost::accumulators::detail::build_acc_list::type boost::accumulators::detail::build_acc_list::call(const Args&, const First&, const Last&) [with Args = boost::parameter::aux::flat_like_arg_list, void> >, std::integral_constant >, boost::parameter::aux::flat_like_arg_tuple, boost::parameter::aux::tagged_argument, std::array >, std::integral_constant > >; First = boost::fusion::mpl_iterator, boost::accumulators::tag::max>, boost::mpl::v_item, boost::accumulators::tag::mean>, boost::mpl::v_item, boost::accumulators::tag::sum>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item, boost::mpl::vector0, 0>, 0>, 0>, 0>, 0>, 0>, 1> >; Last = boost::fusion::mpl_iterator, boost::accumulators::tag::max>, boost::mpl::v_item, boost::accumulators::tag::mean>, boost::mpl::v_item, boost::accumulators::tag::sum>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square_quantile_quadratic>, boost::mpl::v_item, boost::accumulators::tag::extended_p_square>, boost::mpl::v_item, boost::mpl::vector0, 0>, 0>, 0>, 0>, 0>, 0>, 6> >]’ at /usr/include/boost/accumulators/framework/depends_on.hpp:252:86: +/usr/include/boost/accumulators/statistics/extended_p_square_quantile.hpp:57:12: error: ‘.boost::accumulators::detail::accumulator_wrapper, boost::accumulators::tag::extended_p_square_quantile_quadratic>::.boost::accumulators::impl::extended_p_square_quantile_impl::probability’ is used uninitialized [-Werror=uninitialized] + 57 | struct extended_p_square_quantile_impl + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Kefu Chai +--- + boost/accumulators/statistics/extended_p_square_quantile.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/boost/accumulators/statistics/extended_p_square_quantile.hpp b/boost/accumulators/statistics/extended_p_square_quantile.hpp +index f57304c..a4ac3cd 100644 +--- a/boost/accumulators/statistics/extended_p_square_quantile.hpp ++++ b/boost/accumulators/statistics/extended_p_square_quantile.hpp +@@ -76,6 +76,7 @@ namespace impl + boost::begin(args[extended_p_square_probabilities]) + , boost::end(args[extended_p_square_probabilities]) + ) ++ , probability() + { + } + +-- +2.39.2 diff --git a/boost.spec b/boost.spec index 8e0e329..8f69652 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.81.0 -Release: 7%{?dist} +Release: 8%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -152,6 +152,9 @@ Patch5: boost-1.76.0-fix-narrowing-conversions-for-ppc.patch # https://github.com/boostorg/phoenix/issues/115 Patch6: boost-1.81-phoenix-multiple-defn.patch +# PR https://github.com/boostorg/accumulators/pull/54 +Patch7: boost-1.81.0-always-initialize-member-variable.patch + %bcond_with tests %bcond_with docs_generated @@ -1281,6 +1284,10 @@ fi %{_mandir}/man1/b2.1* %changelog +* Sun Aug 20 2023 Kefu Chai - 1.81.0-8 +- Add patch for Boost.Accumulators bug + See https://github.com/boostorg/accumulators/pull/54 + * Wed Aug 2 2023 Tom Callaway - 1.81.0-7 - add symlink for b2 files From ae5b7e3dd08418848ec1788e84906dd273b79f03 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 25 May 2024 12:51:24 +0800 Subject: [PATCH 2/7] Add patch for addressing a Boost.Math bug This change addresses the issue of https://github.com/boostorg/math/issues/1132 the patch addresses the issue where float_next() and float_prior() return a domain error instead +INF or -INF. this issue is a regression in Boost 1.79. Signed-off-by: Kefu Chai (cherry picked from commit e13a584ab74584d6f5a6c002fb10e11994b91f5b) --- ...t-float_next-INF-and-float_prior-INF.patch | 118 ++++++++++++++++++ boost.spec | 11 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch diff --git a/boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch b/boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch new file mode 100644 index 0000000..d804a90 --- /dev/null +++ b/boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch @@ -0,0 +1,118 @@ +From f3e0cde514e444c2e25a3522d05a6e244fb2f23a Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Fri, 17 May 2024 19:17:04 +0100 +Subject: [PATCH 1/2] Correct float_next(+INF) and float_prior(-INF) Fixes + https://github.com/boostorg/math/issues/1132 + +--- + include/boost/math/special_functions/next.hpp | 32 ++++++++++++++----- + test/test_next.cpp | 11 +++++-- + 2 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/include/boost/math/special_functions/next.hpp b/include/boost/math/special_functions/next.hpp +index c696b97b5..02a208e4e 100644 +--- a/boost/math/special_functions/next.hpp ++++ b/boost/math/special_functions/next.hpp +@@ -194,10 +194,14 @@ T float_next_imp(const T& val, const std::true_type&, const Policy& pol) + + int fpclass = (boost::math::fpclassify)(val); + +- if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE)) ++ if (fpclass == (int)FP_INFINITE) + { +- if(val < 0) ++ if (val < 0) + return -tools::max_value(); ++ return val; // +INF ++ } ++ else if (fpclass == (int)FP_NAN) ++ { + return policies::raise_domain_error( + function, + "Argument must be finite, but got %1%", val, pol); +@@ -243,10 +247,14 @@ T float_next_imp(const T& val, const std::false_type&, const Policy& pol) + + int fpclass = (boost::math::fpclassify)(val); + +- if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE)) ++ if (fpclass == (int)FP_INFINITE) + { +- if(val < 0) ++ if (val < 0) + return -tools::max_value(); ++ return val; // +INF ++ } ++ else if (fpclass == (int)FP_NAN) ++ { + return policies::raise_domain_error( + function, + "Argument must be finite, but got %1%", val, pol); +@@ -328,10 +336,14 @@ T float_prior_imp(const T& val, const std::true_type&, const Policy& pol) + + int fpclass = (boost::math::fpclassify)(val); + +- if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE)) ++ if (fpclass == (int)FP_INFINITE) + { +- if(val > 0) ++ if (val > 0) + return tools::max_value(); ++ return val; // -INF ++ } ++ else if (fpclass == (int)FP_NAN) ++ { + return policies::raise_domain_error( + function, + "Argument must be finite, but got %1%", val, pol); +@@ -378,10 +390,14 @@ T float_prior_imp(const T& val, const std::false_type&, const Policy& pol) + + int fpclass = (boost::math::fpclassify)(val); + +- if((fpclass == (int)FP_NAN) || (fpclass == (int)FP_INFINITE)) ++ if (fpclass == (int)FP_INFINITE) + { +- if(val > 0) ++ if (val > 0) + return tools::max_value(); ++ return val; // -INF ++ } ++ else if (fpclass == (int)FP_NAN) ++ { + return policies::raise_domain_error( + function, + "Argument must be finite, but got %1%", val, pol); +diff --git a/test/test_next.cpp b/test/test_next.cpp +index b4f05b437..8bb5f8d99 100644 +--- a/libs/math/test/test_next.cpp ++++ b/libs/math/test/test_next.cpp +@@ -171,12 +171,12 @@ void test_values(const T& val, const char* name) + BOOST_CHECK_EQUAL(boost::math::float_advance(val, primes[i]), v1); + BOOST_CHECK_EQUAL(boost::math::float_advance(val, -primes[i]), v2); + } +- if(std::numeric_limits::is_specialized && (std::numeric_limits::has_infinity)) ++ BOOST_IF_CONSTEXPR(std::numeric_limits::is_specialized && (std::numeric_limits::has_infinity)) + { + BOOST_CHECK_EQUAL(boost::math::float_prior(std::numeric_limits::infinity()), (std::numeric_limits::max)()); + BOOST_CHECK_EQUAL(boost::math::float_next(-std::numeric_limits::infinity()), -(std::numeric_limits::max)()); +- BOOST_MATH_CHECK_THROW(boost::math::float_prior(-std::numeric_limits::infinity()), std::domain_error); +- BOOST_MATH_CHECK_THROW(boost::math::float_next(std::numeric_limits::infinity()), std::domain_error); ++ BOOST_CHECK_EQUAL(boost::math::float_prior(-std::numeric_limits::infinity()), -std::numeric_limits::infinity()); ++ BOOST_CHECK_EQUAL(boost::math::float_next(std::numeric_limits::infinity()), std::numeric_limits::infinity()); + if(boost::math::policies:: BOOST_MATH_OVERFLOW_ERROR_POLICY == boost::math::policies::throw_on_error) + { + BOOST_MATH_CHECK_THROW(boost::math::float_prior(-(std::numeric_limits::max)()), std::overflow_error); +@@ -188,6 +188,11 @@ void test_values(const T& val, const char* name) + BOOST_CHECK_EQUAL(boost::math::float_next((std::numeric_limits::max)()), std::numeric_limits::infinity()); + } + } ++ BOOST_IF_CONSTEXPR(std::numeric_limits::is_specialized && (std::numeric_limits::has_quiet_NaN)) ++ { ++ BOOST_MATH_CHECK_THROW(boost::math::float_prior((std::numeric_limits::quiet_NaN)()), std::domain_error); ++ BOOST_MATH_CHECK_THROW(boost::math::float_next((std::numeric_limits::quiet_NaN)()), std::domain_error); ++ } + // + // We need to test float_distance over multiple orders of magnitude, + // the only way to get an accurate true result is to count the representations +-- +2.45.1 + diff --git a/boost.spec b/boost.spec index 8f69652..4e0e14a 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.81.0 -Release: 8%{?dist} +Release: 9%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -155,6 +155,10 @@ Patch6: boost-1.81-phoenix-multiple-defn.patch # PR https://github.com/boostorg/accumulators/pull/54 Patch7: boost-1.81.0-always-initialize-member-variable.patch +# https://github.com/boostorg/math/commit/f3e0cde514e444c2e25a3522d05a6e244fb2f23a +# https://github.com/boostorg/math/issues/1132 +Patch8: boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch + %bcond_with tests %bcond_with docs_generated @@ -1284,6 +1288,11 @@ fi %{_mandir}/man1/b2.1* %changelog +* Sat May 25 2024 Kefu Chai - 1.81.0-9 +- Add patch to fix Boost.Math bug where float_next(+INF) and float_prior(-INF) + returns NaN, but they should return +INF and -INF respectively. + See https://github.com/boostorg/math/issues/1132 + * Sun Aug 20 2023 Kefu Chai - 1.81.0-8 - Add patch for Boost.Accumulators bug See https://github.com/boostorg/accumulators/pull/54 From aebf7af53e7b6f3323a730e8dfb166be055463f5 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 12 Sep 2023 13:07:24 +0100 Subject: [PATCH 3/7] Remove dropped patches These were dropped from the spec file but not removed from git. --- ...fix_multiprecision_issue_419-ppc64le.patch | 27 ------- boost-1.78.0-fix-b2-staging.patch | 72 ------------------- 2 files changed, 99 deletions(-) delete mode 100644 boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch delete mode 100644 boost-1.78.0-fix-b2-staging.patch diff --git a/boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch b/boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch deleted file mode 100644 index 5cd6d40..0000000 --- a/boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch +++ /dev/null @@ -1,27 +0,0 @@ -From d1343f28dcbe25b100b082b34775bd92ead4602c Mon Sep 17 00:00:00 2001 -From: jzmaddock -Date: Tue, 25 Jan 2022 09:27:40 +0000 -Subject: [PATCH] Update gcc Intel intrinsic usage config. Fixes - https://github.com/boostorg/multiprecision/issues/419. - ---- - include/boost/multiprecision/cpp_int/intel_intrinsics.hpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp b/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp -index eb4624bb4..37717cd51 100644 ---- a/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp -+++ b/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp -@@ -19,7 +19,11 @@ - // If this is GCC/clang, then check that the actual intrinsic exists: - // - #if defined(__has_builtin) && defined(__GNUC__) --#if !__has_builtin(__builtin_ia32_addcarryx_u64) && defined(BOOST_MP_HAS_IMMINTRIN_H) && !(defined(BOOST_GCC) && (__GNUC__ >= 9)) -+#if !__has_builtin(__builtin_ia32_addcarryx_u64) && defined(BOOST_MP_HAS_IMMINTRIN_H) \ -+ && !(defined(BOOST_GCC) && (__GNUC__ >= 9) \ -+ && (defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)\ -+ || defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_AMD64) \ -+ || defined(_M_X64) || defined(__amd64__) || defined(_M_X64))) - #undef BOOST_MP_HAS_IMMINTRIN_H - #endif - #elif defined(BOOST_MP_HAS_IMMINTRIN_H) && defined(__GNUC__) && !(defined(BOOST_GCC) && (__GNUC__ >= 9)) diff --git a/boost-1.78.0-fix-b2-staging.patch b/boost-1.78.0-fix-b2-staging.patch deleted file mode 100644 index fa0e212..0000000 --- a/boost-1.78.0-fix-b2-staging.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 78fd284a42caabe8815cb0870b46e5567872e75b Mon Sep 17 00:00:00 2001 -From: Dmitry -Date: Sat, 11 Dec 2021 16:58:23 +0300 -Subject: [PATCH] Don't skip install targets if there's no in ureqs - (#113) - ---- - src/tools/stage.jam | 4 ++++ - test/install_build_no.py | 26 ++++++++++++++++++++++++++ - test/test_all.py | 1 + - 3 files changed, 31 insertions(+) - create mode 100755 test/install_build_no.py - -diff --git a/tools/build/src/tools/stage.jam b/tools/build/src/tools/stage.jam -index c5f02e3ba4..325129dc81 100644 ---- a/tools/build/src/tools/stage.jam -+++ b/tools/build/src/tools/stage.jam -@@ -478,6 +478,10 @@ class install-target-class : basic-target - return [ sequence.unique $(result2) ] ; - } - -+ rule skip-from-usage-requirements ( ) -+ { -+ } -+ - # Returns true iff 'type' is subtype of some element of 'types-to-include'. - # - local rule include-type ( type : types-to-include * ) -diff --git a/tools/build/test/install_build_no.py b/tools/build/test/install_build_no.py -new file mode 100755 -index 0000000000..0ccf3c5cc6 ---- /dev/null -+++ b/tools/build/test/install_build_no.py -@@ -0,0 +1,26 @@ -+#!/usr/bin/python -+ -+# Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) -+# Distributed under the Boost Software License, Version 1.0. -+# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) -+ -+# Check that no in usage-requirements of dependencies does not affect -+# install rule, i.e. a skipped installed target does not affect insallation of -+# other targets. -+ -+import BoostBuild -+ -+t = BoostBuild.Tester() -+ -+t.write("a.cpp", "int main() {}\n") -+ -+t.write("jamroot.jam", """ -+make x : : maker : no ; -+exe a : a.cpp ; -+install install : x a ; -+""") -+ -+t.run_build_system() -+t.expect_addition("install/a.exe") -+ -+t.cleanup() -diff --git a/tools/build/test/test_all.py b/tools/build/test/test_all.py -index b7ef5ad701..9ed729d017 100644 ---- a/tools/build/test/test_all.py -+++ b/tools/build/test/test_all.py -@@ -250,6 +250,7 @@ def reorder_tests(tests, first_test): - "inherit_toolset", - "inherited_dependency", - "inline", -+ "install_build_no", - "libjpeg", - "liblzma", - "libpng", From 0276e583db5a5d207e64feac8ab47df2ffd5204b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 7 Jun 2024 18:51:49 +0800 Subject: [PATCH 4/7] Add patch for fixing a test failure in Boost.Random the patch addresses a test failure in Boost.Random: ``` terminate called after throwing an instance of 'boost::wrapexcept' what(): Error in function float_next(double): Overflow Error Running 21 test cases... unknown location(0): fatal error: in "distributions_test_ (boost__multiprecision__expression_template_option)1>_ double>>": signal: SIGABRT (application abort requested) multiprecision_float_test.cpp(115): last checkpoint ``` The backported patch is included by boost 1.84 See https://github.com/boostorg/random/pull/88 Signed-off-by: Kefu Chai --- boost-1.84-random-test-overflow.patch | 30 +++++++++++++++++++++++++++ boost.spec | 8 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 boost-1.84-random-test-overflow.patch diff --git a/boost-1.84-random-test-overflow.patch b/boost-1.84-random-test-overflow.patch new file mode 100644 index 0000000..5c8f6de --- /dev/null +++ b/boost-1.84-random-test-overflow.patch @@ -0,0 +1,30 @@ +From 4239d93dad32a11e4c3829050f8070d456266133 Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Wed, 1 Jun 2022 19:35:36 +0100 +Subject: [PATCH] Update multiprecision_float_test.cpp to not overflow type + double. Previously the max value for uint1024_t could just squeeze into a + double because truncation occurred during the conversion, now that cpp_int + performs correctly rounded conversions, overflow occurs, and the computation + fails. Changed the problem distribution to use a multiprecision weight type, + rather than double. + +--- + test/multiprecision_float_test.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/multiprecision_float_test.cpp b/test/multiprecision_float_test.cpp +index bc2a936..2b53483 100644 +--- a/libs/random/test/multiprecision_float_test.cpp ++++ b/libs/random/test/multiprecision_float_test.cpp +@@ -77,7 +77,7 @@ typedef boost::mpl::list < + boost::random::lognormal_distribution, + boost::random::normal_distribution, + #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS +- boost::random::piecewise_constant_distribution, ++ boost::random::piecewise_constant_distribution, + boost::random::piecewise_linear_distribution, + #endif + boost::random::student_t_distribution, +-- +2.45.2 + diff --git a/boost.spec b/boost.spec index 4e0e14a..ca3fc4e 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.81.0 -Release: 9%{?dist} +Release: 10%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -159,6 +159,9 @@ Patch7: boost-1.81.0-always-initialize-member-variable.patch # https://github.com/boostorg/math/issues/1132 Patch8: boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch +# https://github.com/boostorg/random/pull/88 +Patch9: boost-1.84-random-test-overflow.patch + %bcond_with tests %bcond_with docs_generated @@ -1288,6 +1291,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Fri Jun 07 2024 Kefu Chai - 1.81.0-10 +- Add patch to fix test failure in Boost.Random. + * Sat May 25 2024 Kefu Chai - 1.81.0-9 - Add patch to fix Boost.Math bug where float_next(+INF) and float_prior(-INF) returns NaN, but they should return +INF and -INF respectively. From 6f35a0c6e413bf1ea4d62cb7fef9c0890d8e4dca Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 6 Jun 2024 14:25:51 +0100 Subject: [PATCH 5/7] Add missing Requires for rpminspect errors. --- boost.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/boost.spec b/boost.spec index ca3fc4e..ae76f17 100644 --- a/boost.spec +++ b/boost.spec @@ -226,6 +226,7 @@ provides a sort of cooperative multitasking on a single thread. %package coroutine Summary: Run-time component of boost coroutine library +Requires: %{name}-context%{?_isa} = %{version}-%{release} %description coroutine Run-time support for Boost.Coroutine, a library that provides @@ -245,6 +246,8 @@ on generic programming concepts. %if %{with context} %package fiber Summary: Run-time component of boost fiber library +Requires: %{name}-context%{?_isa} = %{version}-%{release} +Requires: %{name}-filesystem%{?_isa} = %{version}-%{release} %description fiber @@ -254,6 +257,7 @@ micro-/userland-threads (fibers) scheduled cooperatively. %package filesystem Summary: Run-time component of boost filesystem library +Requires: %{name}-atomic%{?_isa} = %{version}-%{release} Requires: %{name}-system%{?_isa} = %{version}-%{release} %description filesystem @@ -282,6 +286,7 @@ stream buffers and i/o filters. %package json Summary: Run-time component of boost json library +Requires: %{name}-container%{?_isa} = %{version}-%{release} %description json @@ -302,6 +307,11 @@ handling tools. %package log Summary: Run-time component of boost logging library +Requires: %{name}-atomic%{?_isa} = %{version}-%{release} +Requires: %{name}-chrono%{?_isa} = %{version}-%{release} +Requires: %{name}-filesystem%{?_isa} = %{version}-%{release} +Requires: %{name}-regex%{?_isa} = %{version}-%{release} +Requires: %{name}-thread%{?_isa} = %{version}-%{release} %description log @@ -434,6 +444,7 @@ with as little as one #include and one additional line of code. Summary: Run-time component of boost type erasure library Requires: %{name}-chrono%{?_isa} = %{version}-%{release} Requires: %{name}-system%{?_isa} = %{version}-%{release} +Requires: %{name}-thread%{?_isa} = %{version}-%{release} %description type_erasure @@ -1291,6 +1302,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Thu Jun 06 2024 Jonathan Wakely - 1.81.0-10 +- Add missing Requires for rpminspect errors. + * Fri Jun 07 2024 Kefu Chai - 1.81.0-10 - Add patch to fix test failure in Boost.Random. From 2ec8af445c6a2c8d1a26af5b1c0e1022da5bd63e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 7 Jun 2024 17:56:13 +0100 Subject: [PATCH 6/7] Add patch to fix another test failure in Boost.Random. --- boost-1.84-random-test-overflow.patch | 33 +++++++++++++++++++++++++-- boost.spec | 5 +++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/boost-1.84-random-test-overflow.patch b/boost-1.84-random-test-overflow.patch index 5c8f6de..27565c3 100644 --- a/boost-1.84-random-test-overflow.patch +++ b/boost-1.84-random-test-overflow.patch @@ -25,6 +25,35 @@ index bc2a936..2b53483 100644 boost::random::piecewise_linear_distribution, #endif boost::random::student_t_distribution, --- -2.45.2 +From 7561690135c67ecf88c2133bad7680ebd2665c36 Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Wed, 1 Jun 2022 19:32:55 +0100 +Subject: [PATCH] Update multiprecision_int_test.cpp to not accidentality + overflow type double. Multiprecision now performs correct rounding when + converting to double - previously the max value for uint1024_t would just fit + in a double if it was truncated. But now that it's correctly rounded it + overflows and breaks the calculation. + +--- + test/multiprecision_int_test.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/test/multiprecision_int_test.cpp b/test/multiprecision_int_test.cpp +index 41ec229b5..a861cca39 100644 +--- a/libs/random/test/multiprecision_int_test.cpp ++++ b/libs/random/test/multiprecision_int_test.cpp +@@ -215,8 +215,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(discrete_distributions, distribution_type, other_d + distribution_type d2; + ss >> d2; + BOOST_CHECK(d == d2); +- +- boost::random::independent_bits_engine::digits, boost::multiprecision::uint1024_t > big_random; ++ // ++ // The number of digits in the independent_bits_engine must be low enough that we don't overflow ++ // when converting to a double (see other_distributions declared above). ++ // ++ boost::random::independent_bits_engine::digits - 2, boost::multiprecision::uint1024_t > big_random; + for(unsigned i = 0; i < 200; ++i) + { + result_type r = d(big_random); diff --git a/boost.spec b/boost.spec index ae76f17..0f1e6c6 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.81.0 -Release: 10%{?dist} +Release: 11%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -1302,6 +1302,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Fri Jun 07 2024 Jonathan Wakely - 1.81.0-11 +- Add patch to fix another test failure in Boost.Random. + * Thu Jun 06 2024 Jonathan Wakely - 1.81.0-10 - Add missing Requires for rpminspect errors. From ec9cd8a4aa54e4462b43474e60422e169f6b1e99 Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Thu, 7 Sep 2023 11:54:15 +0000 Subject: [PATCH 7/7] tests/boost-testsuite-sanity: adapt to rpm package > 4.18.91, use the proper rpm macro value to determine the required path --- tests/boost-testsuite-sanity/runtest.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/boost-testsuite-sanity/runtest.sh b/tests/boost-testsuite-sanity/runtest.sh index 98e9842..76e3d45 100755 --- a/tests/boost-testsuite-sanity/runtest.sh +++ b/tests/boost-testsuite-sanity/runtest.sh @@ -54,9 +54,11 @@ rlJournalStart rlPhaseStartSetup "build boost" rlRun "rpm -D \"_topdir $TmpDir\" -U *.src.rpm" rlRun "dnf builddep -y $TmpDir/SPECS/*.spec" + rlRun "sed -i -e 's/^%prep/%prep\n%dump/' $TmpDir/SPECS/*.spec" rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/rpmbuild.log" - rlRun "cd $TmpDir/BUILD/boost*" + rlRun "toplev_dirname=`awk '/toplev_dirname/{print $3; exit}' $TmpDir/rpmbuild.log`" + rlRun "cd $TmpDir/BUILD/$toplev_dirname" rlRun "su -c './bootstrap.sh &>$TmpDir/bootstrap.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/bootstrap.log" rlPhaseEnd @@ -64,7 +66,7 @@ rlJournalStart rlPhaseStartTest "run testsuite" while read test_path; do if [ -f $TmpDir/BUILD/boost*/libs/$test_path/test/Jamfile* ]; then - rlRun "cd $TmpDir/BUILD/boost*/libs/$test_path/test" + rlRun "cd $TmpDir/BUILD/$toplev_dirname/libs/$test_path/test" rlRun "su -c '/usr/bin/b2 -d1 --build-dir=$TmpDir/test-build &>>$TmpDir/testsuite.log' $BUILD_USER" rm -fr $TmpDir/test-build else