zeromq/azmq

azmq fails to compile with boost 1.66 due to changes in asio

ogrant opened this issue · 17 comments

Hi,

Just tried upgrading my project which uses azmq to user boost 1.66 and there are some breaking changes in the asio library:

In file included from /Users/foo/distrib/include/azmq/context.hpp:12:
/Users/foo/distrib/include/azmq/detail/socket_service.hpp:328:35: error: 'azmq::detail::socket_service::shutdown' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
        boost::system::error_code shutdown(implementation_type & impl,
                                  ^
/Users/foo/distrib/include/boost/asio/io_context.hpp:800:32: note: hidden overloaded virtual function 'boost::asio::io_context::service::shutdown' declared here: different number
      of parameters (0 vs 3)
  BOOST_ASIO_DECL virtual void shutdown();
                               ^
/Users/foo/distrib/include/azmq/socket.hpp:109:35: error: use of undeclared identifier 'implementation'
        if (get_service().do_open(implementation, type, optimize_single_threaded, ec))
                                  ^
/Users/foo/distrib/include/azmq/socket.hpp:115:38: error: use of undeclared identifier 'implementation'
        get_service().move_construct(implementation,
                                     ^
/Users/foo/distrib/include/azmq/socket.hpp:117:44: error: no member named 'implementation' in 'azmq::socket'
                                     other.implementation);
                                     ~~~~~ ^
/Users/foo/distrib/include/azmq/socket.hpp:121:35: error: use of undeclared identifier 'implementation'
        get_service().move_assign(implementation,
                                  ^
/Users/foo/distrib/include/azmq/socket.hpp:123:39: error: no member named 'implementation' in 'azmq::socket'
                                  rhs.implementation);
                                  ~~~ ^

Also, on a side note, it would be great if you could more regularly version (using a tag) the azmq library so a specific code level can more easily be recoverable from github.

Thanks for the library and all the effort you've put into it.

O.

Hi Tom,

Thanks for the quick reply. I actually looked just a bit into it and the fix (at least to get the code to compile) looks fairly trivial: rename socket_service::shutdown to something else and replace references to implementation with get_implementation() in service.hpp.

I haven't tested anything since I am bumping into other non-azmq compilation errors for now but will let you know if I find anything else.

Thanks,

O.

Hello,

For me, replacing implementation with get_implementation() throughout was enough - azmq compiles and passes its selftests now, and works fine in my application. I've submitted a merge request.

Cheers,
Vlad

Closing this, happy to reopen if there other 1.66 issues.

Hi, I'd like to grab this latest version but our build system requires specific versioning. Would it be possible for you to create a new tag for this specific code level ? Thanks in advance.

Sorry for the delay, I've tagged a v1.0.1 bugfix release now.

Thanks,
Tom.

No problem, thanks.

On the other hand, I am still seeing a compilation error:

In file included from include/azmq/socket.hpp:14:
In file included from include/azmq/context.hpp:12:
include/azmq/detail/socket_service.hpp:329:35: error: 'azmq::detail::socket_service::shutdown' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
        boost::system::error_code shutdown(implementation_type & impl,
                                  ^   
include/boost/asio/io_context.hpp:800:32: note: hidden overloaded virtual function 'boost::asio::io_context::service::shutdown' declared here: different number
      of parameters (0 vs 3)
  BOOST_ASIO_DECL virtual void shutdown();
                               ^   
1 error generated.

Regards,
O.

Btw, this compilation issue shows up when compiling with -Wall. We compile with -Werror in addition to -Wall which is why the build is failing for us.

Well I still haven't managed to reproduce this issue, going to try and back out what ChrisK changed in 1.66 here and get a fix together.

@ogrant Any chance you can grab the PR I just submitted and apply locally to confirm it resolves your issue?

@rodgert No problem, I'll try it out shortly.

I've just reviewed the change. Could I ask you to tag this version once you merge your pull request ? Thanks in advance.

Yes, though generally I let somebody else merge my PRs (per the ZeroMQ process). If nobody steps up to merge the PR, I'll do it and then tag a 1.0.2 over the weekend.

Thank you. I’ll give it a try later on and let you know if I bump into any other issue.