FreeBSD Bugzilla – Attachment 238733 Details for
Bug 268337
math/R-cran-isoband: fix build with clang/libc++ 15
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
math/R-cran-isoband: fix build with clang/libc++ 15
math__R-cran-isoband-fix-clang15-build-1.diff (text/plain), 4.44 KB, created by
Dimitry Andric
on 2022-12-12 17:37:56 UTC
(
hide
)
Description:
math/R-cran-isoband: fix build with clang/libc++ 15
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2022-12-12 17:37:56 UTC
Size:
4.44 KB
patch
obsolete
>commit 76f82d14a8ff1d220e39c72f6968d9618b7f9241 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: Mon Dec 12 18:34:48 2022 +0100 > > math/R-cran-isoband: fix build with clang/libc++ 15 > > During an exp-run for llvm 15 (see bug 265425), it turned out that > math/R-cran-isoband failed to build with clang and libc++ 15: > > In file included from test-runner.cpp:8: > In file included from testthat/testthat.h:65: > In file included from testthat/vendor/catch.h:377: > In file included from /usr/include/c++/v1/sstream:186: > In file included from /usr/include/c++/v1/istream:165: > In file included from /usr/include/c++/v1/ostream:168: > In file included from /usr/include/c++/v1/bitset:128: > In file included from /usr/include/c++/v1/string:551: > In file included from /usr/include/c++/v1/string_view:222: > In file included from /usr/include/c++/v1/algorithm:1851: > In file included from /usr/include/c++/v1/__algorithm/ranges_sample.h:13: > In file included from /usr/include/c++/v1/__algorithm/sample.h:18: > /usr/include/c++/v1/__random/uniform_int_distribution.h:235:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value': > static_assert(__libcpp_random_is_valid_urng<_URNG>::value, ""); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /usr/include/c++/v1/__algorithm/shuffle.h:154:35: note: in instantiation of function template specialization 'std::uniform_int_distribution<>::operator()<Catch::RandomNumberGenerator>' requested here > difference_type __i = __uid(__g, _Pp(0, __d)); > ^ > /usr/include/c++/v1/__algorithm/shuffle.h:166:14: note: in instantiation of function template specialization 'std::__shuffle<std::_ClassicAlgPolicy, std::__wrap_iter<Catch::TestCase *>, std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here > (void)std::__shuffle<_ClassicAlgPolicy>( > ^ > testthat/vendor/catch.h:7189:18: note: in instantiation of function template specialization 'std::shuffle<std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here > std::shuffle( vector.begin(), vector.end(), rng ); > ^ > testthat/vendor/catch.h:7207:44: note: in instantiation of function template specialization 'Catch::RandomNumberGenerator::shuffle<std::vector<Catch::TestCase>>' requested here > RandomNumberGenerator::shuffle( sorted ); > ^ > > This was fixed in https://github.com/r-lib/testthat/commit/81dfbed7 by > upstream. > >diff --git a/math/R-cran-isoband/files/patch-commit-81dfbed7 b/math/R-cran-isoband/files/patch-commit-81dfbed7 >new file mode 100644 >index 000000000000..84871ffb9554 >--- /dev/null >+++ b/math/R-cran-isoband/files/patch-commit-81dfbed7 >@@ -0,0 +1,48 @@ >+commit 81dfbed7428a526acf7c97937902fc36d7eaeb21 >+Author: Kevin Ushey <kevinushey@gmail.com> >+Date: Wed Sep 21 15:50:44 2022 -0700 >+ >+ Use compatible RNG with shuffle (#1688) >+ >+ Fixes #1687 >+ >+diff --git src/testthat/vendor/catch.h src/testthat/vendor/catch.h >+index e8a10b07..83818641 100644 >+--- src/testthat/vendor/catch.h >++++ src/testthat/vendor/catch.h >+@@ -7165,27 +7165,23 @@ namespace Catch { >+ // #included from: catch_test_case_registry_impl.hpp >+ #define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED >+ >+-#include <vector> >++#include <algorithm> >+ #include <set> >+ #include <sstream> >+-#include <algorithm> >++#include <vector> >++ >++#ifdef CATCH_CONFIG_CPP11_SHUFFLE >++#include <random> >++#endif >+ >+ namespace Catch { >+ >+ struct RandomNumberGenerator { >+- typedef std::ptrdiff_t result_type; >+- >+- result_type operator()( result_type n ) const { return rand() % n; } >+- >+-#ifdef CATCH_CONFIG_CPP11_SHUFFLE >+- static constexpr result_type min() { return 0; } >+- static constexpr result_type max() { return 1000000; } >+- result_type operator()() const { return rand() % max(); } >+-#endif >+ template<typename V> >+ static void shuffle( V& vector ) { >+- RandomNumberGenerator rng; >+ #ifdef CATCH_CONFIG_CPP11_SHUFFLE >++ std::random_device device; >++ std::mt19937 rng( device() ); >+ std::shuffle( vector.begin(), vector.end(), rng ); >+ #else >+ random_shuffle( vector.begin(), vector.end(), rng );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 268337
: 238733