Skip to content

MDEV-36926 Support building against Asio 1.14.1 through 1.38.0#58

Open
mariadb-TeemuOllakka wants to merge 11 commits into
MariaDB:mariadb-4.xfrom
mariadb-TeemuOllakka:mariadb-4.x-MDEV-36926
Open

MDEV-36926 Support building against Asio 1.14.1 through 1.38.0#58
mariadb-TeemuOllakka wants to merge 11 commits into
MariaDB:mariadb-4.xfrom
mariadb-TeemuOllakka:mariadb-4.x-MDEV-36926

Conversation

@mariadb-TeemuOllakka

Copy link
Copy Markdown

Make the provider build across all current Asio releases and against
any Asio in the supported range, not just the bundled copy.

CMake (cmake/asio.cmake):

  • Add GALERA_CUSTOM_ASIO_PATH to build against an out-of-tree Asio.
  • Lower the minimum version to 1.14.1 to match the bundled copy and
    drop the upper bound, so newer Asio is compiled rather than rejected
    at configure time.

Source: Asio 1.33.0 enables ASIO_NO_DEPRECATED by default and removes
a batch of long-deprecated APIs. Fix the breakages, guarded by
ASIO_VERSION < 103300 to stay compatible with older versions:

  • io_context replaces the removed io_service typedef (via a native_type
    in AsioIoService::Impl); post()/reset() -> asio::post()/restart().
  • basic_waitable_timer::expires_from_now() -> expires_after().
  • asio::ip::address::from_string() -> asio::ip::make_address(); include
    asio/version.hpp so the guard is evaluated correctly.
  • The removed resolver::query/resolver::iterator give way to the
    resolve(host, service[, flags]) overload; the resolve helpers now
    return the first resolved endpoint directly, simplifying callers.

Replace the remaining boost::bind uses with lambdas: Boost 1.74.0 no
longer injects boost::bind's placeholders into the global namespace,
so the unqualified usage failed to compile (seen with Asio 1.30.2).

Add scripts/test_asio_versions.sh: builds and runs the unit tests
against the bundled copy and the latest patch of every released Asio
major.minor from 1.14 to 1.38. The whole range passes.

hemantdangi-gc and others added 11 commits May 8, 2026 13:07
Adjust page_size in top_level_seqno_lock_protects_ist_buffers to
account for 4.ee per-page meta overhead (gcache::Page::meta_size()).
Make the provider build across all current Asio releases and against
any Asio in the supported range, not just the bundled copy.

CMake (cmake/asio.cmake):
* Add GALERA_CUSTOM_ASIO_PATH to build against an out-of-tree Asio.
* Lower the minimum version to 1.14.1 to match the bundled copy and
  drop the upper bound, so newer Asio is compiled rather than rejected
  at configure time.

Source: Asio 1.33.0 enables ASIO_NO_DEPRECATED by default and removes
a batch of long-deprecated APIs. Fix the breakages, guarded by
ASIO_VERSION < 103300 to stay compatible with older versions:
* io_context replaces the removed io_service typedef (via a native_type
 in AsioIoService::Impl); post()/reset() -> asio::post()/restart().
* basic_waitable_timer::expires_from_now() -> expires_after().
* asio::ip::address::from_string() -> asio::ip::make_address(); include
  asio/version.hpp so the guard is evaluated correctly.
* The removed resolver::query/resolver::iterator give way to the
  resolve(host, service[, flags]) overload; the resolve helpers now
  return the first resolved endpoint directly, simplifying callers.

Replace the remaining boost::bind uses with lambdas: Boost 1.74.0 no
longer injects boost::bind's placeholders into the global namespace,
so the unqualified usage failed to compile (seen with Asio 1.30.2).

Add scripts/test_asio_versions.sh: builds and runs the unit tests
against the bundled copy and the latest patch of every released Asio
major.minor from 1.14 to 1.38. The whole range passes.
Add REPORT_ASIO_VERSION() to cmake/asio.cmake, which locates the
asio/version.hpp of the Asio actually picked (custom path, system, or
bundled), decodes ASIO_VERSION and prints "Using Asio version
<major>.<minor>.<patch>" so the configure output shows which Asio the
build resolved to.
asio::io_context exists in all supported Asio versions (1.14.1+), so
drop the ASIO_VERSION < 103300 guards that fell back to the deprecated
asio::io_service typedef for the include and native_type.

@janlindstrom janlindstrom 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.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants