Bug 271488 - devel/boost-libs: apply upstream patch for C++17 support
Summary: devel/boost-libs: apply upstream patch for C++17 support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Office Team
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-18 13:12 UTC by Dimitry Andric
Modified: 2023-05-18 21:39 UTC (History)
1 user (show)

See Also:
fluffy: maintainer-feedback+


Attachments
Fix boost/functional for removed functions in C++17 (3.12 KB, patch)
2023-05-18 13:13 UTC, Dimitry Andric
fluffy: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-05-18 13:12:30 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Several ports that use boost/functional.hpp now complain with (for
example print/libmspub01):

  In file included from MSPUBCollector.cpp:17:
  In file included from /usr/local/include/boost/multi_array.hpp:34:
  In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32:
  /usr/local/include/boost/functional.hpp:45:24: error: no member named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
              using std::unary_function;
                    ~~~~~^~~~~~~~~~~~~~
                         __unary_function
  /usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
  using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
  ^
  In file included from MSPUBCollector.cpp:17:
  In file included from /usr/local/include/boost/multi_array.hpp:34:
  In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32:
  /usr/local/include/boost/functional.hpp:46:24: error: no member named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
              using std::binary_function;
                    ~~~~~^~~~~~~~~~~~~~~
                         __binary_function
  /usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
  using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
  ^

This is because std::unary_function and std::binary_function were
removed from C++17. Upstream boost/functional fixed this in
https://github.com/boostorg/functional/commit/6a573e4, so apply that
patch until boost 1.83.0 is released with it.

From looking at the logs of https://pkg-status.freebsd.org/gohan05/build.html?mastername=mainamd64PR271047-default&build=2023-05-14_19h35m09s, at least the following boost-using ports are affected:

* print/libmspub01
* finance/quantlib
* science/rmf
* games/wesnoth
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-18 13:13:15 UTC
Created attachment 242249 [details]
Fix boost/functional for removed functions in C++17
Comment 2 Dima Panov freebsd_committer freebsd_triage 2023-05-18 19:36:56 UTC
Go forward!
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-18 21:37:39 UTC
A commit in branch main references this bug:

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

commit c035007f958a9fa3c45bb1441a63540be39018ed
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-18 13:10:20 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 21:33:57 +0000

    devel/boost-libs: apply upstream patch for C++17 support

    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Several ports that use boost/functional.hpp now complain with (for
    example print/libmspub01):

      In file included from MSPUBCollector.cpp:17:
      In file included from /usr/local/include/boost/multi_array.hpp:34:
      In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32:
      /usr/local/include/boost/functional.hpp:45:24: error: no member named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
                  using std::unary_function;
                        ~~~~~^~~~~~~~~~~~~~
                             __unary_function
      /usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
      using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
      ^
      In file included from MSPUBCollector.cpp:17:
      In file included from /usr/local/include/boost/multi_array.hpp:34:
      In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32:
      /usr/local/include/boost/functional.hpp:46:24: error: no member named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
                  using std::binary_function;
                        ~~~~~^~~~~~~~~~~~~~~
                             __binary_function
      /usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
      using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
      ^

    This is because std::unary_function and std::binary_function were
    removed from C++17. Upstream boost/functional fixed this in
    https://github.com/boostorg/functional/commit/6a573e4, so apply that
    patch until boost 1.83.0 is released with it.

    PR:             271488
    Approved by:    fluffy (maintainer)
    MFH:            2023Q2

 devel/boost-libs/Makefile                          |  2 +-
 .../files/patch-boost_functional.hpp (new)         | 28 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)