Opened 6 years ago

Closed 5 years ago

#57645 closed defect (fixed)

Boost.asio problem on Mojave

Reported by: mouse07410 (Mouse) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: michaelld (Michael Dickens)
Port: boost

Description

I'm trying to build https://github.com/randombit/botan.git on Mojave with Xcode-10.1. The build fails with boost.asio being unable to correctly deal with string_view. Happens wit Xcode Clang, and with Macports clang-7.0 :

clang++ -fPIC -fvisibility=hidden -fstack-protector -m64 -pthread -stdlib=libc++ -maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include -std=c++11 -D_REENTRANT -maes -mpclmul -msse2 -mssse3 -msse4 -msse4.2 -mrdseed -mrdrnd -mavx2 -mavx512f -std=gnu++17 -Os -Ofast -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual  -Ibuild/include -Ibuild/include/external -c src/lib/utils/socket/socket.cpp -o build/obj/lib/utils_socket.o
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
In file included from /opt/local/include/boost/asio/buffer.hpp:27:
In file included from /opt/local/include/boost/asio/detail/string_view.hpp:23:
/opt/local/libexec/llvm-7.0/include/c++/v1/experimental/string_view:11:2: error: "<experimental/string_view> has been removed. Use <string_view> instead."
#error "<experimental/string_view> has been removed. Use <string_view> instead."
 ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
In file included from /opt/local/include/boost/asio/buffer.hpp:27:
/opt/local/include/boost/asio/detail/string_view.hpp:32:12: error: no member named 'experimental' in namespace 'std'
using std::experimental::basic_string_view;
      ~~~~~^
/opt/local/include/boost/asio/detail/string_view.hpp:33:12: error: no member named 'experimental' in namespace 'std'
using std::experimental::string_view;
      ~~~~~^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
/opt/local/include/boost/asio/buffer.hpp:1489:5: error: no template named 'basic_string_view'; did you mean 'std::basic_string_view'?
    basic_string_view<Elem, Traits> data) BOOST_ASIO_NOEXCEPT
    ^~~~~~~~~~~~~~~~~
    std::basic_string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:194:28: note: 'std::basic_string_view' declared here
class _LIBCPP_TEMPLATE_VIS basic_string_view {
                           ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
/opt/local/include/boost/asio/buffer.hpp:1510:5: error: no template named 'basic_string_view'; did you mean 'std::basic_string_view'?
    basic_string_view<Elem, Traits> data,
    ^~~~~~~~~~~~~~~~~
    std::basic_string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:194:28: note: 'std::basic_string_view' declared here
class _LIBCPP_TEMPLATE_VIS basic_string_view {
                           ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
/opt/local/include/boost/asio/ip/address_v4.hpp:288:44: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address_v4 make_address_v4(string_view str);
                                           ^~~~~~~~~~~
                                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
/opt/local/include/boost/asio/ip/address_v4.hpp:295:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
In file included from /opt/local/include/boost/asio/ip/address_v4.hpp:328:
/opt/local/include/boost/asio/ip/impl/address_v4.ipp:193:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v4 make_address_v4(string_view str)
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
In file included from /opt/local/include/boost/asio/ip/address_v4.hpp:328:
/opt/local/include/boost/asio/ip/impl/address_v4.ipp:198:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v4 make_address_v4(string_view str,
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
/opt/local/include/boost/asio/ip/address_v6.hpp:277:44: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address_v6 make_address_v6(string_view str);
                                           ^~~~~~~~~~~
                                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
/opt/local/include/boost/asio/ip/address_v6.hpp:284:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
In file included from /opt/local/include/boost/asio/ip/address_v6.hpp:335:
/opt/local/include/boost/asio/ip/impl/address_v6.ipp:309:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v6 make_address_v6(string_view str)
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
In file included from /opt/local/include/boost/asio/ip/address_v6.hpp:335:
/opt/local/include/boost/asio/ip/impl/address_v6.ipp:314:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v6 make_address_v6(string_view str,
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
/opt/local/include/boost/asio/ip/address.hpp:218:38: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address make_address(string_view str);
                                     ^~~~~~~~~~~
                                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
/opt/local/include/boost/asio/ip/address.hpp:226:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:259:
/opt/local/include/boost/asio/ip/impl/address.ipp:140:22: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address make_address(string_view str)
                     ^~~~~~~~~~~
                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:259:
/opt/local/include/boost/asio/ip/impl/address.ipp:145:22: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address make_address(string_view str,
                     ^~~~~~~~~~~
                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:80:
In file included from /opt/local/include/boost/asio/ip/basic_resolver.hpp:27:
In file included from /opt/local/include/boost/asio/ip/basic_resolver_iterator.hpp:27:
/opt/local/include/boost/asio/ip/basic_resolver_entry.hpp:54:7: error: no type named 'string_view' in namespace 'boost::asio'; did you mean 'std::string_view'?
      BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      std::string_view
/opt/local/include/boost/asio/detail/string_view.hpp:42:39: note: expanded from macro 'BOOST_ASIO_STRING_VIEW_PARAM'
# define BOOST_ASIO_STRING_VIEW_PARAM boost::asio::string_view
                                      ^~~~~~~~~~~~~
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:80:
In file included from /opt/local/include/boost/asio/ip/basic_resolver.hpp:27:
In file included from /opt/local/include/boost/asio/ip/basic_resolver_iterator.hpp:27:
/opt/local/include/boost/asio/ip/basic_resolver_entry.hpp:54:42: error: no type named 'string_view' in namespace 'boost::asio'; did you mean 'std::string_view'?
      BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         std::string_view
/opt/local/include/boost/asio/detail/string_view.hpp:42:39: note: expanded from macro 'BOOST_ASIO_STRING_VIEW_PARAM'
# define BOOST_ASIO_STRING_VIEW_PARAM boost::asio::string_view
                                      ^~~~~~~~~~~~~
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [build/obj/lib/utils_socket.o] Error 1

It looks like this issue has been fixed for Asio? https://github.com/chriskohlhoff/asio/commit/68df16d560c68944809bb2947360fe8035e9ae0a

Change History (6)

comment:1 Changed 6 years ago by michaelld (Michael Dickens)

I'd suggest trying applying the fix you note to your local Boost install, clean your builds, and see if it works & let this ticket know. I have no objection to adding this fix, but I'm also not in a position to test it out at the moment due to workload.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: michaelld added; ryandesign michaelld@… removed
Owner: set to ryandesign
Status: newassigned

comment:3 Changed 6 years ago by mohd-akram (Mohamed Akram)

comment:4 Changed 6 years ago by michaelld (Michael Dickens)

OK good to know; thanks! Seems like the right solution is to update to 1.69.0 ... for better or worse probably only a little earlier than 1.70.0 is release LOL. Each Boost release causes -some- issues with various Ports I support; I love the progress they're making, but it does come at a cost in terms of finding the hours to support the changes.

comment:5 Changed 6 years ago by mouse07410 (Mouse)

I've hit the same problem trying to configure Botan-2.11 (master, unreleased) with Boost.Asio.

Would very much appreciate if Macports could fix it rather sooner than later.

Thanks!

comment:6 in reply to:  3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Replying to mohd-akram:

This is fixed in Boost 1.69.0.

MacPorts updated to boost 1.70.0 in [b09ef91d8de72290191eb87b0b33641b37e5a5ca/macports-ports] so this should no longer be a problem.

Note: See TracTickets for help on using tickets.