Bug 268337

Summary: math/R-cran-isoband: fix build with clang/libc++ 15
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: TAKATSU Tomonari <tota>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (tota)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 265425    
Attachments:
Description Flags
math/R-cran-isoband: fix build with clang/libc++ 15 none

Description Dimitry Andric freebsd_committer freebsd_triage 2022-12-12 17:37:29 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-12 17:37:56 UTC
Created attachment 238733 [details]
math/R-cran-isoband: fix build with clang/libc++ 15
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-12-18 17:44:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2db1448ebd06a798d05b71de18e2718eac691f28

commit 2db1448ebd06a798d05b71de18e2718eac691f28
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-12 17:34:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:34:51 +0000

    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.

    PR:             268337
    Approved by:    portmgr (tcberner)
    MFH:            2022Q4

 .../files/patch-commit-81dfbed7 (new)              | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)