feat(chriskohlhoff.asio): import asio; — 将 Asio 1.38.1 适配为 C++23 模块 (separate compilation)#80
Merged
Conversation
added 2 commits
July 19, 2026 05:33
…ilation)
Add compat.asio-m@1.38.1 — a FORM B inline descriptor exposing standalone
asio as 'import asio;' with ASIO_SEPARATE_COMPILATION mode.
Changes:
- pkgs/c/compat.asio-m.lua: Form B descriptor with generated module wrapper
(37 asio headers included, ~55 using declarations exported: core/io, TCP/UDP
networking, cancellation, experimental channel/use_promise, executor
completeness, and common token adapters)
- tests/examples/asio-module/: 5 tests (core, coroutine, experimental,
network, surface) covering the full exported API surface
- mcpp.toml: add tests/examples/asio-module to workspace members
Tested: mcpp test -p asio-module => 5/5 passed
Regression: mcpp test -p asio => 6/6 passed
mcpp test -p spdlog, nlohmann.json, marzer.tomlplusplus => all OK
Closes mcpplibs#73 (companion to compat.asio PR)
…dules ADL
On GCC (Linux CI), the make_error_code(channel_errors) function
declared in asio/experimental/channel_error.hpp is in the global
module fragment and NOT reachable from the importing TU via ADL.
This causes:
error: use of deleted function 'void std::__adl_only::make_error_code()'
when the channel template destructor instantiates
channel_traits::invoke_receive_cancelled() which constructs
std::error_code from error::channel_cancelled.
Fix: add an explicit exported using declaration:
export namespace asio::experimental::error {
using ::asio::experimental::error::make_error_code;
}
Clang (macOS) apparently tolerates the missing export, but GCC
requires it. Also include channel_error.hpp explicitly in the
global fragment.
Member
|
compat.asio-m 模块化的包, 不用加compat 。namespace可以用库作者或组织的名字或缩写 不用 asio-m 具体参考 |
added 2 commits
July 19, 2026 06:13
…view Upstream requested package name change from compat.asio-m to chriskohlhoff.asio (namespace chriskohlhoff). Consumers can now use: mcpp add chriskohlhoff.asio@1.38.1 (full qualified) mcpp add asio@1.38.1 (shorthand) This is purely a package-name and namespace rename; the C++ module surface (import asio;) is unchanged. Also update the test project's mcpp.toml to match the new index.
…sio@1.38.1 The shorthand 'asio' matches multiple packages in the default registry (compat.asio, mcpplibs.asio), causing resolution conflict. Consumers must use the fully qualified name 'chriskohlhoff.asio' instead. mcpp add chriskohlhoff.asio@1.38.1 (correct, unambiguous) mcpp add asio@1.38.1 (ambiguous, may fail or resolve wrongly)
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.
摘要
新增
chriskohlhoff.asio@1.38.1— 将 Asio 1.38.1 暴露为 C++23 模块import asio;。采用
ASIO_SEPARATE_COMPILATION模式(编译*/src/asio.cpp),是现有 header-only 版compat.asio的模块伴侣包。新增文件
pkgs/c/chriskohlhoff.asio.luausing导出、191 行中文使用文档(含限制、迁移指南)tests/examples/asio-module/mcpp.tomltests/examples/asio-module/tests/core.cpptests/examples/asio-module/tests/coroutine.cpptests/examples/asio-module/tests/experimental.cpptests/examples/asio-module/tests/network.cpptests/examples/asio-module/tests/surface.cpp修改文件
mcpp.toml"tests/examples/asio-module"导出的 API 范围
不可用的组件(需额外依赖/平台相关)
SSL/TLS、Unix domain sockets、POSIX descriptors、Windows handles、serial_port、pipes、file I/O、spawn()(需 Boost.Context,已禁用)、deadline_timer(已废弃)。详见描述符注释。
验证