Fails to build with Asio 1.33.0 / Boost 1.87
As can be seen in https://www.boost.org/doc/libs/1_87_0/doc/html/boost_asio/history.html a bunch of deprecated facilities of ASIO have finally been removed, meaning AZMQ doesn't build any more.
I have not checked how difficult it's to fix. But at the very least "Removed deprecated alias io_service" breaks mostly everything.
I got most of it working on boost 1.87 but I'm not 100% sure how backwards compatible it is 😅
Also for some reason I can't get the coroutine tests working on 1.87
https://github.com/jp-pino/azmq
Also for some reason I can't get the coroutine tests working on 1.87
Without even looking at those tests, could it be this (from the ASIO changelog)
Removed Boost.Coroutine-based spawn() overloads. The spawn() function now works only with the fiber support in Boost.Context.
This issue is becoming increasingly painful as more distros move to newer boost versions.
I've started a PR to try to get my changes merged. Looks like it's working for most Ubuntu/Boost combinations.
Also for some reason I can't get the coroutine tests working on 1.87
In recent Boost.Asio versions,
boost::asio::spawnhas a third parameter for the completion token. If you don’t supply it, it defaults toboost::asio::deferred, which returns a value that’s marked[[nodiscard]].
Seems like explicitly passing boost::asio::detached as third parameter to boost::asio::spawn (which tells Asio “fire and forget”) fixes "Async Operation Send/Receive with stackful coroutine" test.
might need #include <boost/asio/detached.hpp>
Oh, and there are a few more tests which use boost::asio::spawn. Their checks are done inside completion handlers but those are probably never called. So those tests can't fail but they probably don't test anything with Boost 1.87. So they also seem to need boost::asio::deferred (which should also silence compiler warnings about not using [[nodiscard]] value 😁)
I decided on using boost::asio::use_future as it triggers the execution immediately and verified that the future completes at the end of the test. This way we also make sure that the validations inside the lambda are executed as well.
It's working for ubuntu-22.04 and ubuntu-24.04 for Boost versions 1.68 through 1.89