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

Depend on the independent Asio instead of Boost.Asio by default #382

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

BewareMyPower
Copy link
Contributor

Fixes #367

Motivation

See the difference of Asio and Boost.Asio here: https://think-async.com/Asio/AsioAndBoostAsio.html

Asio is updated more frequently than Boost.Asio and its release does not need to be synchronous with other Boost components. Depending on the independent Asio could make it easier for a newer Asio release.

Modifications

Import asio 1.28.2 as the dependency and remove the boost-asio dependency from the vcpkg.json. Since the latest Asio already removed the deadline_timer, this patch replaces all deadline_timer with steady_timer, which uses std::chrono rather than Boost.Date_Time component to compute the timeout.

Add a USE_ASIO CMake option to determine whether Asio or Boost.Asio is depended. For vcpkg users, the option is always enabled.

Finally, simplify the vcpkg.json by removing some boost-* dependencies depended indirectly by the rest two major dependencies:

  • boost-accumulators: latency percentiles computation
  • boost-property-tree: JSON operations

These two dependencies are hard to remove for now unless introducing other dependencies so they will be kept from some time.

Fixes apache#367

### Motivation

See the difference of Asio and Boost.Asio here: https://think-async.com/Asio/AsioAndBoostAsio.html

Asio is updated more frequently than Boost.Asio and its release does not
need to be synchronous with other Boost components. Depending on the
independent Asio could make it easier for a newer Asio release.

### Modifications

Import `asio` 1.28.2 as the dependency and remove the `boost-asio`
dependency from the vcpkg.json. Since the latest Asio already removed
the `deadline_timer`, this patch replaces all `deadline_timer` with
`steady_timer`, which uses `std::chrono` rather than Boost.Date_Time
component to compute the timeout.

Add a `USE_ASIO` CMake option to determine whether Asio or Boost.Asio is
depended. For vcpkg users, the option is always enabled.

Finally, simplify the vcpkg.json by removing some `boost-*` dependencies
depended indirectly by the rest two major dependencies:
- boost-accumulators: latency percentiles computation
- boost-property-tree: JSON operations

These two dependencies are hard to remove for now unless introducing
other dependencies so they will be kept from some time.
@merlimat merlimat merged commit 90ea369 into apache:main Jan 7, 2024
12 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/asio-default branch January 8, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce the Boost dependencies and replace Boost.Asio with Asio
2 participants