Skip to content

build: Boost.Asio handler-invoke compat shim (conan 1.90 vs legacy system Boost 1.83)#641

Merged
frstrtr merged 2 commits into
masterfrom
ci-steward/asio-boost-compat
Jul 5, 2026
Merged

build: Boost.Asio handler-invoke compat shim (conan 1.90 vs legacy system Boost 1.83)#641
frstrtr merged 2 commits into
masterfrom
ci-steward/asio-boost-compat

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What / why

Master is RED: every coin's core fails building addr_store.cpp on the self-hosted runner (VM905) with:

/usr/include/boost/asio/impl/system_executor.hpp:58:5:
error: 'boost_asio_handler_invoke_helpers' has not been declared

Root cause is a mixed-Boost include collision, not a code regression:

  • conan pins Boost 1.90 (BOOST_VERSION 109000), which removed boost/asio/detail/handler_invoke_helpers.hpp and the boost_asio_handler_invoke_helpers namespace (the asio_handler_invoke hooks were deprecated in 1.79, dropped since).
  • VM905 also carries a system Boost 1.83 under /usr/include. Its boost/asio/impl/system_executor.hpp leaks onto the include path and still calls boost_asio_handler_invoke_helpers::invoke(...), which the conan (>= 1.90) tree no longer declares.

The include chain from the failing TU: conan boost/asio/system_executor.hpp:714 -> system /usr/include/boost/asio/impl/system_executor.hpp. Any core TU that pulls asio hits it, so it is latent across all five coins and re-fires on every ccache eviction.

Fix

core/boost_asio_compat.hpp supplies the namespace's historical default hook-free invoke (copy the function, call it) — identical to how Boost >= 1.90 dispatches internally. It is force-included ahead of every C++ TU via a COMPILE_LANGUAGE:CXX-gated add_compile_options in the top-level CMakeLists.txt, so all coins survive cache eviction. Guarded on BOOST_VERSION >= 108400 and claims Boost's own include guard, so it is inert on any Boost that still ships the namespace.

Build compat only — no behaviour change. c2pool defines no asio_handler_invoke overloads (verified), so the hook-free default is behaviourally equivalent.

Durable follow-up (infra, not this PR)

The lasting cleanup is removing the stray system libboost-dev 1.83 from VM905 so the conan pin is the only Boost the build sees. This shim is the cache-eviction-proof safety net requested regardless.

Signed, attribution-clean. Merge-gated — holding for push-approval per Rule 12.

frstrtr added 2 commits July 5, 2026 09:08
… system Boost

conan pins Boost 1.90, which removed boost/asio/detail/handler_invoke_helpers.hpp
and the boost_asio_handler_invoke_helpers namespace. On build hosts carrying a
legacy system Boost (e.g. libboost-dev 1.83 under /usr/include), that trees
Windows/MSVC has no legacy system Boost under /usr/include to leak
boost/asio/impl/system_executor.hpp, so it never needs the shim and
cannot resolve the relative force-include path (C1083). Wrap the
add_compile_options in if(NOT MSVC); Linux/macOS keep the proven fix.
@frstrtr frstrtr merged commit 7e1a14f into master Jul 5, 2026
24 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.

1 participant