Skip to content

feat: upgrade Boost and migrate io_service to io_context#49

Merged
sn1f3rt merged 7 commits intomasterfrom
feat/boost-upgrade-io-context
Mar 24, 2026
Merged

feat: upgrade Boost and migrate io_service to io_context#49
sn1f3rt merged 7 commits intomasterfrom
feat/boost-upgrade-io-context

Conversation

@sn1f3rt
Copy link
Copy Markdown
Member

@sn1f3rt sn1f3rt commented Mar 19, 2026

Summary

  • Port of Fix build with boost ASIO 1.87. Support boost 1.66+ monero-project/monero#9628 and depends: boost: update to 1.84.0 monero-project/monero#9162
  • Upgrade depends Boost from 1.64.0 to 1.89.0, remove old 1.64 patches
  • Migrate boost::asio::io_service to boost::asio::io_context across 33 files
  • Replace deprecated Boost.Asio APIs (io_service::work, strand.wrap(), expires_from_now, address::from_string, rfc2818_verification, deadline_timer, resolver::query, mutable_buffers_1/const_buffers_1, io_context::strand, etc.) with modern equivalents
  • Migrate io_context::strand to boost::asio::strand<executor_type> across connection, socks, and levin_notify code
  • Remove Boost/ICU version pins from CI Windows and macOS builds — use whatever the package manager ships
  • Add explicit mingw-w64-x86_64-icu dependency for Windows CI builds
  • Link ICU DLL import libraries on Windows static builds (MSYS2's boost_locale requires shared ICU)
  • Remove unsupported -ffile-prefix-map flag from Darwin depends Boost build

Fixes #44

Test plan

  • Ubuntu build passes
  • macOS build passes
  • Windows build passes
  • libwallet build passes
  • All depends cross-compilation targets pass

@sn1f3rt sn1f3rt added the enhancement New feature or request label Mar 19, 2026
@sn1f3rt sn1f3rt self-assigned this Mar 19, 2026
@sn1f3rt sn1f3rt changed the title feat: upgrade Boost and migrate io_service to io_context WIP: upgrade Boost and migrate io_service to io_context Mar 19, 2026
@sn1f3rt sn1f3rt changed the title WIP: upgrade Boost and migrate io_service to io_context feat: upgrade Boost and migrate io_service to io_context Mar 20, 2026
@sn1f3rt sn1f3rt force-pushed the feat/boost-upgrade-io-context branch 2 times, most recently from d8ce45a to ee4aa5a Compare March 22, 2026 07:13
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 22, 2026

Build Artifacts

Target Status Download
nerva-linux-armv7 Download
nerva-linux-armv8 Download
nerva-windows-x32 Download
nerva-linux-i686 Download
nerva-windows-x64 Download
nerva-linux-x86_64 Download
nerva-macos-x64 Download
nerva-macos-armv8 Download
nerva-freebsd-x86_64 Download
nerva-android-armv8 Download

10 succeeded, 0 failed | View workflow run

@sn1f3rt sn1f3rt force-pushed the feat/boost-upgrade-io-context branch from ee4aa5a to b698986 Compare March 22, 2026 07:53
sn1f3rt added 7 commits March 22, 2026 13:26
Port of monero-project/monero#9628 and #9162.

- Upgrade depends Boost from 1.64.0 to 1.89.0
- Remove old Boost 1.64 patches (fix_aroptions, fix_arm_arch)
- Migrate boost::asio::io_service to boost::asio::io_context
- Replace io_service::work with executor_work_guard
- Replace strand.wrap() with boost::asio::bind_executor()
- Replace strand.post()/dispatch() with boost::asio::post()/dispatch()
- Replace deprecated Boost.Asio APIs (expires_from_now, reset, etc.)
- Replace GET_IO_SERVICE macro with MONERO_GET_EXECUTOR
- Add SSL hostname verification compatibility macro for Boost >= 1.73
- Remove Boost/ICU version pins from CI Windows and macOS builds

Fixes #44
- Replace deadline_timer with steady_timer in async_blocked_mode_client
- Replace resolver::query/iterator with resolver::resolve()/results_type
- Replace mutable_buffers_1/const_buffers_1 with mutable_buffer/const_buffer
- Replace io_context::strand with strand<any_io_executor> in socks client
- Update smtp async_resolve to use new callback signature
- Replace io_context::strand with strand<any_io_executor> in
  connection_basic, levin_notify, and socks client
- Remove -ffile-prefix-map from Darwin Boost build (unsupported by
  cross-compilation clang)
Rename icuin to icui18n to match the actual library name in modern
ICU versions shipped by MSYS2. Boost.Locale 1.89 links against ICU
and needs these libraries resolved at link time.
Revert icui18n back to icuin (correct MSYS2 name). Add
mingw-w64-x86_64-icu to Windows build dependencies since Boost 1.89's
locale library requires ICU dev libraries at link time.
MSYS2's boost_locale is compiled against ICU shared libraries, so its
object files contain __imp_ (DLL import) references. When building
statically, the linker only finds .a files but needs .dll.a import
libraries to resolve these symbols. Explicitly link the .dll.a import
libraries when STATIC is set on MINGW.
Add mingw-w64-x86_64-icu to MSYS2 dependencies (required by
Boost.Locale). Bump minimum Boost version from 1.58 to 1.66 to
reflect the modern Boost.Asio APIs now used.
@sn1f3rt sn1f3rt force-pushed the feat/boost-upgrade-io-context branch from b698986 to 38527d0 Compare March 22, 2026 07:56
Copy link
Copy Markdown
Contributor

@ngeojiajun ngeojiajun left a comment

Choose a reason for hiding this comment

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

seems fine

@sn1f3rt sn1f3rt merged commit e36e806 into master Mar 24, 2026
15 checks passed
@sn1f3rt sn1f3rt deleted the feat/boost-upgrade-io-context branch March 24, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows build fails with newer Boost due to deprecated io_service Asio header

2 participants