Skip to content

fix(asio): keep std::println usable with import asio - #175

Merged
Sunrisepeak merged 4 commits into
mcpplibs:mainfrom
wellwei:codex/fix-asio-println
Aug 7, 2026
Merged

fix(asio): keep std::println usable with import asio#175
Sunrisepeak merged 4 commits into
mcpplibs:mainfrom
wellwei:codex/fix-asio-println

Conversation

@wellwei

@wellwei wellwei commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Repair the Form B chriskohlhoff.asio@1.38.1 module recipe by propagating Asio's supported ASIO_NO_IOSTREAM define through the default separate-compilation feature.
  • Keep libc++ <print> out of the asio BMI so std::println remains usable after import std; import fmt; import asio;.
  • Extend the active asio-module consumer with the reported import combination and both plain and formatted std::println calls.

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 the asio BMI. With the same standard-library declarations already provided by the std BMI, Clang 22.1.8 can bind std::println incorrectly and reports failures such as:

no member named 'parse' in 'std::__1::formatter<std::__1::basic_format_string<char>>'

Defining ASIO_NO_IOSTREAM at 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-based read_at/write_at overloads. Core socket, timer, coroutine, and asynchronous APIs remain available and continue to be exercised by the consumer tests.

This is a recipe repair only:

  • upstream source URLs and SHA-256 values are unchanged;
  • Linux, macOS, and Windows declarations are unchanged;
  • index.toml's min_mcpp and the workflow mcpp pin are unchanged;
  • no mirror or release asset changes are required.

OpenSSL CI follow-up

The original Linux matrix failure was independent of the Asio BMI repair. compat.openssl@3.5.1 builds through its own Configure/Make flow, and that external build did not inherit the resolved Linux payload paths. GCC therefore failed on stdlib.h, limits.h, and assert.h while asio-module itself had already passed.

An OpenSSL descriptor repair was developed and pushed on this branch, and run 31179027882 passed all eight checks, including Linux asio-module 5/5, asio-ssl 1/1, grpc-module 1/1, and openssl 1/1.

While that run was executing, #174 merged a more complete OpenSSL repair into main. It supplies payload headers, crt objects, and libc search paths and pins the same glibc compatibility range as the GCC toolchain. This branch now includes current main and intentionally carries no duplicate compat.openssl.lua diff.

The generic mcpp install() toolchain contract remains a separate follow-up: external builds should eventually inherit resolved toolchain inputs without descriptor-specific flag plumbing.

Verification

  • Reproduced before the repair on macOS with mcpp 2026.8.6.2, LLVM 22.1.8, and import std; import fmt; import asio;.
  • After merging current main, mcpp test -p asio-module --cache=off with mcpp 2026.8.6.3: 5 passed, 0 failed; both std::println regression lines executed.
  • After merging current main, mcpp test -p asio-ssl --cache=off with mcpp 2026.8.6.3: 1 passed, 0 failed.
  • Lua syntax, mirror URL, package-name, xpkg parse, and git diff --check checks passed for the changed descriptor.
  • Current-head run 31182542503 passed all eight checks: lint, mirror, site, timings, and Linux/macOS/Windows workspace jobs.

@Sunrisepeak Sunrisepeak closed this Aug 7, 2026
@Sunrisepeak Sunrisepeak reopened this Aug 7, 2026
@wellwei wellwei changed the title fix(asio): keep std::println usable with import asio fix(asio, openssl): repair module println and Linux external build Aug 7, 2026
@wellwei wellwei changed the title fix(asio, openssl): repair module println and Linux external build fix(asio): keep std::println usable with import asio Aug 7, 2026
@Sunrisepeak
Sunrisepeak merged commit eb8c338 into mcpplibs:main Aug 7, 2026
8 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.

2 participants