From 76b90ed257de329d6dd81bbfd38d177a64a1ab89 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 7 Jun 2024 18:51:49 +0800 Subject: [PATCH] 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 --- ...ision_float_test.cpp-to-not-overflow.patch | 30 +++++++++++++++++++ boost.spec | 8 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 boost-1.84-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch diff --git a/boost-1.84-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch b/boost-1.84-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch new file mode 100644 index 0000000..5c8f6de --- /dev/null +++ b/boost-1.84-random-Update-multiprecision_float_test.cpp-to-not-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 c470afa..e4488c6 100644 --- a/boost.spec +++ b/boost.spec @@ -46,7 +46,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.83.0 -Release: 6%{?dist} +Release: 7%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -172,6 +172,9 @@ Patch10: boost-1.83-math-Correct-float_next-INF-and-float_prior-INF.patch # https://github.com/boostorg/context/pull/234 Patch11: boost-1.83-Fix-ABI-detection-for-empty-os-platform.patch +# https://github.com/boostorg/random/pull/88 +Patch9: boost-1.84-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch + %bcond_with tests %bcond_with docs_generated @@ -1312,6 +1315,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Fri Jun 07 2024 Kefu Chai - 1.83.0-7 +- Add patch to fix test failure in Boost.Random. + * Thu Jun 06 2024 Jonathan Wakely - 1.83.0-6 - Add missing Requires for rpminspect errors.