fix(asio): keep std::println usable with import asio - #175
Open
wellwei wants to merge 1 commit into
Open
Conversation
Collaborator
Author
CI follow-upThe platform matrix exercised both affected members selected by the workflow (
This OpenSSL failure is reproducible on the current base branch: the recent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chriskohlhoff.asio@1.38.1module recipe by propagating Asio's supportedASIO_NO_IOSTREAMdefine through the default separate-compilation feature.<print>out of theasioBMI sostd::printlnremains usable afterimport std; import fmt; import asio;.asio-moduleconsumer test with the reported import combination and both zero-argument and formattedstd::printlncalls.Root cause
The Asio module wrapper includes the TCP surface. Without
ASIO_NO_IOSTREAM, that path also exposes Asio's iostream adapters and pulls libc++<print>into theasioBMI. With the same standard-library declarations already provided by thestdBMI, Clang 22.1.8 can bindstd::printlnincorrectly and reports failures such as:Defining
ASIO_NO_IOSTREAMat the existing separate-compilation feature boundary keeps the BMI, Asio implementation sources, and consumer TUs on one consistent macro contract.Compatibility
This disables Asio's iostream/streambuf adapter surface, including
basic_socket_iostream(asio::ip::tcp::iostream) and streambuf-basedread_at/write_atoverloads. Core socket, timer, coroutine, and asynchronous APIs remain available and continue to be exercised by the existing consumer tests.This is a recipe repair only:
index.toml'smin_mcppand the workflow mcpp pin are unchanged;Verification
Reproduced before the repair on macOS with mcpp
2026.8.6.2, LLVM22.1.8, andimport std; import fmt; import asio;: the consumer failed in libc++format_functions.hwith the formatter diagnostics above.After the repair:
mcpp test --cache=localfromtests/examples/asio-module: 5 passed, 0 failed; the surface binary printed both expectedstd::printlnlines.MCPP_TIMINGS=/tmp/mcpp-index-asio-pr-timings.tsv bash tests/run_members.sh asio-module: 5 passed, 0 failed.mcpp xpkg parse pkgs/c/chriskohlhoff.asio.luapassed with mcpp2026.8.6.2.git diff --check upstream/main..HEADpassed.Local behavioral coverage is macOS ARM64 only. The PR's required GitHub Actions matrix must provide Linux, macOS, and Windows evidence before merge.