Skip to content

refactor(asio): make module package canonical#109

Merged
Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
wellwei:refactor/asio-module
Jul 24, 2026
Merged

refactor(asio): make module package canonical#109
Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
wellwei:refactor/asio-module

Conversation

@wellwei

@wellwei wellwei commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the transitional compat.asio@1.38.1 header-only package and its consumer tests
  • replace the chriskohlhoff.asio package identity with canonical default-root asio@1.38.1
  • preserve the existing C++23 module wrapper and separate-compilation recipe, with concise usage cautions, limitations, and unexported-component notes

Consumer contract

mcpp add asio@1.38.1
import std;
import asio;

compat.asio@1.38.1 and chriskohlhoff.asio@1.38.1 are removed without aliases. The canonical package is module-only.

Validation

  • Lua syntax and mirror-table checks
  • strict descriptor parse with workflow-pinned mcpp 0.0.101
  • isolated macOS arm64 mcpp test -p asio-module: 5 passed, 0 failed

Linux and Windows module coverage is delegated to PR CI.

No archive URL, SHA-256, mirror, generated wrapper, source list, feature, define, platform flag, mcpp core behavior, or unrelated documentation changes.

@wellwei
wellwei force-pushed the refactor/asio-module branch from 3972203 to 239531f Compare July 21, 2026 07:31
Comment thread pkgs/a/asio.lua Outdated
-- `asio/coroutine.hpp`、`asio/streambuf.hpp`。
package = {
spec = "1",
namespace = "",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

缺少命名空间 以及文件名命名 chriskohlhoff.asio.lua

package = {
spec = "1",
namespace = "chriskohlhoff",
name = "asio",
description = "Standalone asio exposed as the C++23 module asio (separate compilation)",
licenses = {"BSL-1.0"},

wellwei added a commit to wellwei/mcpp-index that referenced this pull request Jul 24, 2026
- Replace chriskohlhoff.asio descriptor with PR mcpplibs#109 content
  (namespace="chriskohlhoff", name="asio" for dual resolution:
  mcpp add chriskohlhoff.asio@1.38.1 / mcpp add asio@1.38.1)
- Remove compat.asio@1.38.1 header-only package and its consumer tests
- Remove tests/examples/asio from workspace members
- Update asio-module test comments to remove mirror references
@wellwei
wellwei force-pushed the refactor/asio-module branch 2 times, most recently from 17f3d5c to 239531f Compare July 24, 2026 16:57
wellwei added a commit to wellwei/mcpp-index that referenced this pull request Jul 24, 2026
…ontent

Move pkgs/a/asio.lua -> pkgs/c/chriskohlhoff.asio.lua with
namespace="chriskohlhoff" so consumers can use both:
  mcpp add chriskohlhoff.asio@1.38.1  (fully qualified)
  mcpp add asio@1.38.1                (short form)

Update asio-module test project index accordingly.
@wellwei
wellwei force-pushed the refactor/asio-module branch from 3233ade to 239531f Compare July 24, 2026 17:03
…ontent

Move pkgs/a/asio.lua -> pkgs/c/chriskohlhoff.asio.lua with
namespace="chriskohlhoff" so consumers can reference it as both
chriskohlhoff.asio@1.38.1 and asio@1.38.1.

Update asio-module test project index accordingly.
@Sunrisepeak
Sunrisepeak merged commit 788ce06 into mcpplibs:main Jul 24, 2026
5 checks passed
Sunrisepeak added a commit that referenced this pull request Jul 25, 2026
#109 把 pkgs/c/chriskohlhoff.asio.lua 的 name 从 "chriskohlhoff.asio"
改成 "asio"(namespace 不变),这是该 commit 对描述符的唯一功能性改动,
其余全是注释重写。结果三平台 workspace job 全部在 tests/examples/asio-module
上失败:

  E_NOT_FOUND: package 'chriskohlhoff:chriskohlhoff.asio@1.38.1' not found

原因是 mcpp 内部两条规则对同一份描述符的口径不一致:身份归一化层
(manifest/xpkg.cppm canonical_xpkg_identity)认为 split 形式
(namespace="chriskohlhoff" + name="asio")与 FQN 形式等价、都合法,
而安装目标构造层(build/prepare.cppm)硬假设 name 字面值就等于
ns + "." + shortName。xlings/libxpkg 按前者的 name 字面值建索引 key
(entries[package.name] = "asio"),mcpp 却拿 "chriskohlhoff.asio" 去点名,
两者永远不相交。

实测四种消费端写法(点式选择器、ns 表内点式、default 索引裸名、别名索引
裸名)全部无解 —— ns 被身份闸门钉死、短名被 xpm 版本表钉死,fqname 恒为
chriskohlhoff.asio 而 key 恒为 asio。等价约束是 name 必须 ==
namespace + "." + <短名>,只能在描述符里修。

改动:

* pkgs/c/chriskohlhoff.asio.lua — name 写回 FQN 形式(与索引内其余 47 个
  namespaced 包一致)。文件路径、namespace、消费端 mcpp.toml 均不动。
* pkgs/t/tensorvia-cpu.lua — 同类隐患(ns="aimol" + name="tensorvia-cpu"),
  今天没被任何 workspace member 消费所以没暴露,但同样装不上;一并修正。
  该文件是 `mcpp emit xpkg` 生成后手工补了 namespace 才落入 split 形式。
* tests/check_package_name.lua + validate.yml rule 5 — namespace 非空时
  强制 name 以 "<namespace>." 开头。lint 秒级拦下,不再让这类错误跑满
  三平台一小时后才炸。

验证(CI 钉住的 mcpp 0.0.102 + vendored xlings 0.4.67,冷 store 冷索引缓存):
tests/examples/asio-module → 5 passed; 0 failed。lint 全量重放 exit 0,
负向测试(把 name 改回 split 形式)如期报错。

上游已提 mcpp-community/mcpp#278:mcpp 要么构造 target 时用描述符声明的
name(loadVersionDep 里 luaContent 已在作用域内),要么收紧规范让
`mcpp xpkg parse` 直接拒绝 split 形式。本 lint 是上游对齐前索引侧的守卫。
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