Skip to content

Commit 772a82d

Browse files
design: the clangd probe's result -- clangd stays native per system inside the one mcppls package
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 025b6f4 commit 772a82d

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

‎.agents/docs/2026-10-29-ecosystem-target-sets-packaging-and-editors-design.md‎

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ app 的 SELinux 域不允许**读** `/`。openkal-linux 以只读方式打开预
363363
|---|---|---|
364364
| 服务器 | `mcppls.okb`(已统一) | 不变 |
365365
| okrun | 本系统的一个 | `runner.hosts` 的全部 |
366-
| clangd | 每系统原生(Ubuntu 20.04 + Clang 12、macOS 14、Windows + MSVC) | `clangd.okb`:两个架构的映像(§8 构建;§9.4 的 probe 决定) |
366+
| clangd | 每系统原生(Ubuntu 20.04 + Clang 12、macOS 14、Windows + MSVC) | 每系统原生,放进同一个包(§9.4:本轮映像不可用) |
367367
| kit | 按宿主选一个 | 包内 openkal kit;目标 kit 按需(§9.2) |
368368

369369
### 9.2 kit 按目标(S4 修订)
@@ -392,17 +392,28 @@ app 的 SELinux 域不允许**读** `/`。openkal-linux 以只读方式打开预
392392
| xlings | 每系统一项 | 一个资产三系统,可装范围取自 `runs_on` |
393393
| 构建 | 4 种主机与工具链 | 一台 Linux;测试在四个系统上(§3.4 的 `--archive`) |
394394

395-
- 覆盖随 okrun 扩大:musl 系统、Alpine、Termux(#857 之后)可用,clangd 不再要求 glibc 2.31;Intel Mac、Windows arm64 在平台加入
396-
对应运行器行后可用。
397-
- 体积(待实测):vsix 约 50–60 MB(0.0.19 每平台 30–40 MB),前提是 clangd 映像的压缩率与原生相近;okb 以 stored 存放,安装后
398-
含另一架构的 clangd(约 75 MB)。
395+
- 覆盖:服务器随 okrun 扩大;clangd 是每系统原生(§9.4),所以整个包的覆盖是"原生 clangd 的系统 ∩ 运行器的宿主",与今天的四个
396+
平台相同。
397+
- 体积(待实测):一个 vsix 含四个原生 clangd,约为今天四个平台包之和减去重复的服务器与 kit。
399398

400-
### 9.4 clangd 映像的 probe(进行中)
399+
### 9.4 clangd 映像的 probe(结论)
401400

402-
mcppls-clangd 的 draft PR(分支 `probe/clangd-openkal-image`),LLVM 源码经 xlings-res 的 GitCode 镜像获取。测量:编译错误清单、
403-
四个系统上 `clangd --check`、Windows 的路径风格(openkal 在 Windows 上给出原生名字;LLVM 的 `Style::native` 在编译期决定,需要
404-
补丁改为运行时读 `kal_env_system`)、与原生 clangd 的耗时与内存(musl 分配器的风险,必要时链接 mimalloc 或 scudo)、映像与 okb
405-
大小。结论写入本节。
401+
mcppls-clangd 的 draft PR #11(分支 `probe/clangd-openkal-image`,run 40908632199)。两个架构的 2848 个目标文件编译通过,映像
402+
链接并封装成功。`clangd --check` 的结果(3 次取中位数):
403+
404+
| 系统 | `--version` | 无头文件 | `import m` | 系统 C++ 标准库 |
405+
|---|---|---|---|---|
406+
| Linux x86_64 | 通过 | 2.49 s / 232 MiB(原生 2.23 s / 122 MiB) | 0.40 s / 141 MiB(原生 0.13 s / 50 MiB) | SIGSEGV |
407+
| Linux aarch64 | 通过 | 2.00 s / 231 MiB(原生 1.88 s / 122 MiB) | 0.33 s / 145 MiB(原生 0.14 s / 49 MiB) | SIGSEGV |
408+
| macOS arm64 | 通过 | 1.56 s / 245 MiB(原生 1.10 s / 153 MiB) | 0.46 s / 165 MiB(原生 0.25 s / 40 MiB) | 1.43 s / 258 MiB(原生 1.11 s / 171 MiB) |
409+
| Windows x64 | 通过 | 失败 | 失败 | 失败 |
410+
411+
- Linux 上解析系统标准库头文件时崩溃,原因未定位。Windows 上 LLVM 的路径风格在编译期为 POSIX,`C:/…` 被当作相对路径,读文件
412+
返回 `EINVAL`。常驻内存比原生多约 90–125 MiB,与映像大小相当(文件 `mmap` 在 openkal 上返回 `ENOSYS`,映像页不共享)。
413+
- **结论:本轮 mcppls 的 clangd 保持每系统原生,四个原生 clangd 与 `mcppls.okb`、全部运行器放进同一个包**(§9.1、§9.3 的"一个
414+
包"不变,体积以原生 clangd 计)。clangd 映像在上面四项解决后替换包内的原生 clangd,包的形状不变。
415+
- probe 发现的两个栈内缺陷在本轮修复:`__cxa_thread_atexit` 在 ok 映像上未导出(openkal-llvm-runtime 0.16.9);`pread`、`pwrite`
416+
返回 `ENOSYS`(openkal-musl 0.22.9)。文件映射(规范层面)、Windows 的 `EINVAL`、Linux 的崩溃另立 issue。
406417

407418
## 10. 编辑器
408419

@@ -475,7 +486,7 @@ mcppls-clangd 的 draft PR(分支 `probe/clangd-openkal-image`),LLVM 源
475486
| 7 | mcpplibs.os | 钉新版本组 |
476487
| 8 | mcpp | SPEC-015、SPEC-014 rev、§5、§6、§8.1;同时接受平台的新旧两种写法;`triple.cppm:909` 钉 openkal-platform 新版 |
477488
| 9 | mcpp-plugins | `deps-cmake` 读契约;`dep_dir` 的歧义失败 |
478-
| 10 | mcppls-clangd | clangd 映像(§9.4 决定)、路径风格补丁、宿主 tblgen |
489+
| 10 | mcppls-clangd | 无改动(§9.4:本轮 clangd 保持原生);probe PR #11 关闭 |
479490
| 11 | mcppls | 单包、S4 修订、kit 流程、CI 改用 `--archive` |
480491
| 12 | mcpp-ide | VS Code(§10.1)、组件库、CLion API、CI 迁移(§13.1) |
481492
| 13 | xim-pkgindex | mcpp-ide、mcppls、okrun 的条目重新生成 |

0 commit comments

Comments
 (0)