Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with upcoming Boost 1.87.0 due to Boost Asio removals #7072

Open
cho-m opened this issue Nov 20, 2024 · 0 comments · May be fixed by #7073
Open

Build fails with upcoming Boost 1.87.0 due to Boost Asio removals #7072

cho-m opened this issue Nov 20, 2024 · 0 comments · May be fixed by #7073

Comments

@cho-m
Copy link

cho-m commented Nov 20, 2024

Issue

Build fails with upcoming Boost 1.87.0 (tested beta1, stable release probably in December) due to Boost Asio removal of some deprecated APIs boostorg/asio@a69e0e1.

/tmp/osrm-backend-20241119-79427-bkjo50/include/server/server.hpp:56:46: error: expected ';' after expression
   56 |         boost::asio::ip::tcp::resolver::query query(address, port_string);
      |                                              ^
      |                                              ;
/tmp/osrm-backend-20241119-79427-bkjo50/include/server/server.hpp:56:9: error: no member named 'query' in 'boost::asio::ip::basic_resolver<boost::asio::ip::tcp>'; did you mean 'boost_asio_query_fn::query'?
   56 |         boost::asio::ip::tcp::resolver::query query(address, port_string);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         boost_asio_query_fn::query

This has been deprecated since Boost 1.66.0 boostorg/asio@b60e92b. Looking at Boost commit, something like following may work:

@@ -53,8 +53,7 @@ class Server
         const auto port_string = std::to_string(port);

         boost::asio::ip::tcp::resolver resolver(io_context);
-        boost::asio::ip::tcp::resolver::query query(address, port_string);
-        boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
+        boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(address, port_string).begin();

         acceptor.open(endpoint.protocol());
 #ifdef SO_REUSEPORT

Steps to reproduce

Please provide the steps required to reproduce your problem.

Specifications

Please provide details of your development environment.

  • Library/dependency versions - Homebrew dependencies
  • Operating system - macOS 15 (local), Ubuntu 22.04 (CI)
  • Hardware - M1 MacBook Pro (local), GCP e2-standard-8 (CI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant