Skip to content

Boost.Asio compatibility#2273

Merged
stephenberry merged 8 commits intostephenberry:mainfrom
azais-corentin:boost-asio-incompatibility
Jan 28, 2026
Merged

Boost.Asio compatibility#2273
stephenberry merged 8 commits intostephenberry:mainfrom
azais-corentin:boost-asio-incompatibility

Conversation

@azais-corentin
Copy link
Contributor

@azais-corentin azais-corentin commented Jan 27, 2026

This fixes #2266.

Summary

This PR fixes the boost-asio.yml workflow which was incorrectly using standalone Asio instead of Boost.Asio, and resolves compilation errors when building with Boost.Asio.

Changes

CI workflow (boost-asio.yml):

  • Disabled bundled standalone Asio (-Dglaze_USE_BUNDLED_ASIO=OFF)
  • Added Boost_ROOT environment variable to properly locate Boost installation

Boost.Asio compatibility:

  • Error code types: In Boost.Asio, asio::error_code is boost::system::error_code which is not implicitly convertible to std::error_code.
    Changed async callback signatures to use asio::error_code consistently.
    Use make_error_code(asio::error::eof) and make_error_code(asio::error::operation_aborted) for comparisons.
  • SSL includes: Added conditional SSL header includes (<asio/ssl.hpp> or <boost/asio/ssl.hpp>) to glaze_asio.hpp
  • http_client.hpp: Now includes glaze_asio.hpp instead of <asio.hpp> directly for proper abstraction

@packit-as-a-service
Copy link

One of the tests failed for ccda9c5. @admin check logs None, packit dashboard https://dashboard.packit.dev/jobs/copr/3194150 and external service dashboard https://copr.fedorainfracloud.org/coprs/build/10068660/

@packit-as-a-service
Copy link

One of the tests failed for a6a0e4b. @admin check logs None, packit dashboard https://dashboard.packit.dev/jobs/copr/3194803 and external service dashboard https://copr.fedorainfracloud.org/coprs/build/10069074/

@packit-as-a-service
Copy link

One of the tests failed for b6ac8a5. @admin check logs None, packit dashboard https://dashboard.packit.dev/jobs/copr/3197101 and external service dashboard https://copr.fedorainfracloud.org/coprs/build/10071319/

@azais-corentin azais-corentin force-pushed the boost-asio-incompatibility branch from b6ac8a5 to 91376f9 Compare January 28, 2026 09:09
@azais-corentin azais-corentin marked this pull request as ready for review January 28, 2026 09:14
@azais-corentin
Copy link
Contributor Author

@stephenberry could you please review this?

@stephenberry
Copy link
Owner

The PR description mentions:

I've added a to_std_error_code helper which can convert a asio::error_code to a std::error_code. There's also is_eof_error and is_operation_aborted_error.

However, these helpers don't appear in the actual diff. The implementation instead uses:

  • asio::error_code consistently throughout the code
  • make_error_code(asio::error::eof) and make_error_code(asio::error::operation_aborted) for comparisons

Could you update the PR description to reflect the actual changes? The current approach works fine, but the description is misleading.

@azais-corentin
Copy link
Contributor Author

Indeed, that's a leftover from a previous attempt. I'll update.

@azais-corentin
Copy link
Contributor Author

There, it's done.

@stephenberry
Copy link
Owner

@azais-corentin, thanks so much working this fix! It looks great! I'm merging it

@stephenberry stephenberry merged commit a31b067 into stephenberry:main Jan 28, 2026
42 checks passed
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.

Compatibility issue with Boost.Asio

2 participants