Skip to content

Replace boost::asio::io_service with boost::asio::io_context for boost 1.88 compatibility - #84

Open
traversaro wants to merge 2 commits into
ROBOTIS-GIT:mainfrom
traversaro:fixboost188
Open

Replace boost::asio::io_service with boost::asio::io_context for boost 1.88 compatibility#84
traversaro wants to merge 2 commits into
ROBOTIS-GIT:mainfrom
traversaro:fixboost188

Conversation

@traversaro

Copy link
Copy Markdown

boost::asio::io_service is just a deprecated typedef of boost::asio::io_context, at least since boost 1.67 (see https://github.com/boostorg/asio/blob/boost-1.67.0/include/boost/asio/io_service.hpp#L27), the boost version used in apt in Ubuntu 20.04 (see https://repology.org/project/boost/versions)

The boost::asio::io_service typedef was removed in Boost 1.88, and this if fixed in this PR by replacing boost::asio::io_service with boost::asio::io_context, that is perfectly back-compatible as boost::asio::io_service was just a typedef for boost::asio::io_context.

Copilot AI review requested due to automatic review settings January 18, 2026 12:54
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @traversaro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's dependency on Boost.Asio by migrating from the deprecated boost::asio::io_service to its modern equivalent, boost::asio::io_context. This change is crucial for maintaining compatibility with recent and future Boost library versions, specifically addressing the removal of io_service in Boost 1.88. The transition is seamless and does not introduce any functional changes, as io_service has long been an alias for io_context.

Highlights

  • Boost.Asio Compatibility: Replaced all occurrences of boost::asio::io_service with boost::asio::io_context across the codebase.
  • Future-Proofing: This change ensures compatibility with Boost versions 1.88 and newer, where boost::asio::io_service has been removed.
  • Backwards Compatibility: The modification is fully backward-compatible as io_service was merely a deprecated typedef for io_context since Boost 1.67.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly replaces the deprecated boost::asio::io_service with boost::asio::io_context to ensure compatibility with newer versions of Boost. The changes are applied consistently across the codebase. My review includes a few minor suggestions to update the corresponding Doxygen comments in header files for consistency, which will improve code documentation and maintainability.

*/

LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_service & io);
LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_context & io);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the code change, it's recommended to update the Doxygen comment for the io parameter on line 54. It should refer to Boost ASIO IO Context instead of Boost ASIO IO Service.

* @param io Boost ASIO IO Service to use when creating the serial port object
*/
explicit LFCDLaser(boost::asio::io_service & io);
explicit LFCDLaser(boost::asio::io_context & io);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency, the Doxygen comment for the io parameter on line 57 should be updated to reflect the change from io_service to io_context. It currently still refers to Boost ASIO IO Service.

* @param io Boost ASIO IO Service to use when creating the serial port object
*/
LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_service & io);
LFCDLaser(const std::string & port, uint32_t baud_rate, boost::asio::io_context & io);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Please update the Doxygen comment for the io parameter on line 55 to refer to Boost ASIO IO Context. This will align the documentation with the code change from io_service to io_context.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the codebase to be compatible with Boost 1.88 by replacing the deprecated boost::asio::io_service typedef with boost::asio::io_context. The io_service typedef was deprecated and has been removed in Boost 1.88, while io_context has been the canonical name since Boost 1.67, making this change backward compatible.

Changes:

  • Replaced all instances of boost::asio::io_service with boost::asio::io_context across source files, headers, and applications
  • Updated constructor signatures and member variable declarations to use io_context
  • Ensured consistency between header declarations and implementation definitions

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/hlds_laser_segment_publisher.cpp Updated constructor parameter and local variable from io_service to io_context
src/hlds_laser_publisher.cpp Updated constructor parameter and local variable from io_service to io_context
include/hls_lfcd_lds_driver/lfcd_laser.hpp Updated constructor parameter type in declaration from io_service to io_context
include/hls_lfcd_lds_driver/hlds_laser_segment_publisher.hpp Updated constructor parameter type in declaration from io_service to io_context
applications/lds_polar_graph/lds_polar_graph.hpp Updated member variable type from io_service to io_context
applications/lds_driver/lds_driver.hpp Updated constructor parameter type in declaration from io_service to io_context
applications/lds_driver/lds_driver.cpp Updated constructor parameter and local variable from io_service to io_context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread applications/lds_driver/lds_driver.hpp Outdated
Comment thread include/hls_lfcd_lds_driver/lfcd_laser.hpp Outdated
Comment thread include/hls_lfcd_lds_driver/hlds_laser_segment_publisher.hpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Silvio Traversaro <silvio@traversaro.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants