Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .agents/docs/2026-05-30-official-mcpp-index-migration-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# xlings: Official mcpp-index Migration Plan

> 状态: in progress
> 分支: `codex/use-official-mcpp-index`
> PR: https://github.com/openxlings/xlings/pull/314
> 目标: xlings 不再维护项目本地 mcpp 索引,直接使用默认官方 mcpp-index,并保持 `mcpp.toml` 简洁可维护。

## 当前问题

当前 `mcpp.toml` 直接包含大量第三方 C 库 configure 宏,并通过本地索引声明 `xlings.libarchive`。这能构建,但不是理想生态:

- xlings 承担了 libarchive/xz/zstd/zlib 等包的维护责任。
- 宏污染根 manifest,后续其他项目无法复用。
- 默认 mcpp-index 不能独立满足 xlings 构建。

## 目标形态

```toml
[indices]
# 不再需要项目本地 xlings mcpp index。

[dependencies]
ftxui = "6.1.9"

[dependencies.compat]
libarchive = "3.8.7"

[dependencies.mcpplibs]
cmdline = "0.0.2"
xpkg = "0.0.41"
tinyhttps = "0.2.3"
capi.lua = "0.0.3"
```

官方包索引采用 `compat.libarchive`,因此 xlings 使用 `[dependencies.compat]` 显式声明归档库,避免项目维护自定义 index。

## xlings 侧待办

- [x] 等 mcpp 0.0.35 发布并本地安装。
- [x] mcpp-index PR #17 提供 `compat.libarchive` 及其传递依赖。
- [x] xim-pkgindex PR #259 已合入,`xim:mcpp` bootstrap 版本升到 `0.0.35`。
- [x] 删除 `mcpp/pkgs/*`。
- [x] 删除 `mcpp/include/*` 中仅为第三方包服务的配置头。
- [x] 精简 `mcpp.toml` 的 `build.cflags`,只保留 xlings 自身语义。
- [x] 更新 `mcpp.lock`。
- [x] 本地验证 glibc target。
- [x] 本地验证 musl static target。
- [x] 创建 xlings PR draft。
- [ ] CI 通过后合入并发布新版本。

## 验证命令

```bash
mcpp self doctor
mcpp build
mcpp build --target x86_64-linux-musl
target/x86_64-linux-gnu/*/bin/xlings --version
target/x86_64-linux-musl/*/bin/xlings --version
```

## Checkpoints

- [x] 文档 checkpoint commit。
- [x] mcpp 0.0.35 本地联调通过。
- [x] 官方 mcpp-index 联调通过。
- [x] xlings PR draft 创建: https://github.com/openxlings/xlings/pull/314
- [ ] CI 每 120s 检查一次直到完成。
- [ ] 合入后发布 xlings 新版本。

## 当前 CI 状态

旧 run 的三平台 CI 失败在 `mcpp build` 的 `compat.libarchive@3.8.7`
下载阶段。根因是 GitHub runner 当时使用的官方 mcpp-index `main` 尚未包含
`compat.libarchive`。

截至 2026-05-30:

- mcpp PR #88 已合入并发布 `v0.0.35`。
- mcpplibs/mcpp-index PR #17 已合入 main。
- openxlings/xim-pkgindex PR #259 已合入 main,CI/release 现在 pin 到
`cf3d0fa64e8be120c3c703c8702f294f271026ad`,包含 `xim:mcpp@0.0.35`。
- xlings CI/release 在安装 mcpp 后会清理缓存中的默认 `mcpplibs` index checkout,
避免 actions/cache 恢复旧 index 后看不到刚合入的 `compat.*` 包。
- 下一步是重跑 xlings PR #314 CI,验证官方 index 路径和新版 mcpp bootstrap。
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ env:
# Pinned bootstrap xlings used to install mcpp. Bump together with
# XIM_PKGINDEX_REF so release uses a known-good xlings + package index pair.
BOOTSTRAP_XLINGS_VERSION: v0.4.44
# Includes mcpp 0.0.33 for all release builds.
XIM_PKGINDEX_REF: ab8e20d496741caadad4627706e5ce2c46a6c4b1
# Includes mcpp 0.0.35 for all release builds.
XIM_PKGINDEX_REF: cf3d0fa64e8be120c3c703c8702f294f271026ad

jobs:
build-linux:
Expand Down Expand Up @@ -71,6 +71,11 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
run: |
rm -rf "$HOME/.mcpp/registry/data/mcpplibs"
rm -rf "$GITHUB_WORKSPACE/.mcpp/registry/data/mcpplibs"

- name: Prepare fixture index repo
run: |
bash tests/e2e/prepare_fixture_index.sh
Expand Down Expand Up @@ -132,6 +137,11 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
run: |
rm -rf "$HOME/.mcpp/registry/data/mcpplibs"
rm -rf "$GITHUB_WORKSPACE/.mcpp/registry/data/mcpplibs"

- name: Build (macos_release)
run: |
chmod +x ./tools/macos_release.sh
Expand Down Expand Up @@ -198,6 +208,12 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
shell: pwsh
run: |
Remove-Item -Recurse -Force "$env:USERPROFILE\.mcpp\registry\data\mcpplibs" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:GITHUB_WORKSPACE\.mcpp\registry\data\mcpplibs" -ErrorAction SilentlyContinue

- name: Build (windows_release)
shell: pwsh
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/xlings-ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
# Pinned bootstrap xlings used to install mcpp. Bump together with
# XIM_PKGINDEX_REF so CI uses a known-good xlings + package index pair.
BOOTSTRAP_XLINGS_VERSION: v0.4.44
# Includes mcpp 0.0.33 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: ab8e20d496741caadad4627706e5ce2c46a6c4b1
# Includes mcpp 0.0.35 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: cf3d0fa64e8be120c3c703c8702f294f271026ad

jobs:
build-and-test:
Expand Down Expand Up @@ -72,6 +72,11 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
run: |
rm -rf "$HOME/.mcpp/registry/data/mcpplibs"
rm -rf "$GITHUB_WORKSPACE/.mcpp/registry/data/mcpplibs"

- name: Prepare unit fixture index repo
run: |
bash tests/e2e/prepare_fixture_index.sh ../xim-pkgindex
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/xlings-ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ env:
# Pinned bootstrap xlings used to install mcpp. Bump together with
# XIM_PKGINDEX_REF so CI uses a known-good xlings + package index pair.
BOOTSTRAP_XLINGS_VERSION: v0.4.44
# Includes mcpp 0.0.33 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: ab8e20d496741caadad4627706e5ce2c46a6c4b1
# Includes mcpp 0.0.35 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: cf3d0fa64e8be120c3c703c8702f294f271026ad

jobs:
build-and-test:
Expand Down Expand Up @@ -68,6 +68,11 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
run: |
rm -rf "$HOME/.mcpp/registry/data/mcpplibs"
rm -rf "$GITHUB_WORKSPACE/.mcpp/registry/data/mcpplibs"

- name: Prepare unit fixture index repo
run: |
bash tests/e2e/prepare_fixture_index.sh ../xim-pkgindex
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/xlings-ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
# Pinned bootstrap xlings used to install mcpp. Bump together with
# XIM_PKGINDEX_REF so CI uses a known-good xlings + package index pair.
BOOTSTRAP_XLINGS_VERSION: v0.4.44
# Includes mcpp 0.0.33 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: ab8e20d496741caadad4627706e5ce2c46a6c4b1
# Includes mcpp 0.0.35 for all CI/release mcpp builds.
XIM_PKGINDEX_REF: cf3d0fa64e8be120c3c703c8702f294f271026ad

jobs:
build-and-test:
Expand Down Expand Up @@ -76,6 +76,12 @@ jobs:
mcpp --version
mcpp self version

- name: Refresh mcpp package index cache
shell: pwsh
run: |
Remove-Item -Recurse -Force "$env:USERPROFILE\.mcpp\registry\data\mcpplibs" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:GITHUB_WORKSPACE\.mcpp\registry\data\mcpplibs" -ErrorAction SilentlyContinue

- name: Prepare unit fixture index repo
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .xlings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"projectScope": false,
"mirror": "GLOBAL",
"workspace": {
"mcpp": "0.0.33"
"mcpp": "0.0.35"
}
}
11 changes: 6 additions & 5 deletions mcpp.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Auto-generated by mcpp. Do not edit by hand.
version = 2

[package."compat.libarchive"]
namespace = "compat"
version = "3.8.7"
source = "index+compat@3.8.7"
hash = "fnv1a:e412742c0533bef7"

[package."ftxui"]
namespace = "mcpplibs"
version = "6.1.9"
Expand Down Expand Up @@ -31,8 +37,3 @@ version = "0.0.41"
source = "index+mcpplibs@0.0.41"
hash = "fnv1a:6b8e5df6e20e74c3"

[package."xlings.libarchive"]
namespace = "xlings"
version = "3.8.7"
source = "index+xlings@3.8.7"
hash = "fnv1a:034847c4d720ad37"
62 changes: 4 additions & 58 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,7 @@ license = "Apache-2.0"
repo = "https://github.com/openxlings/xlings"

[build]
include_dirs = ["mcpp/include", "src/libs/json"]
cflags = [
"-D_GNU_SOURCE",
"-DSIZEOF_SIZE_T=8",
"-DHAVE_STDBOOL_H=1",
"-DHAVE__BOOL=1",
"-DHAVE_STDINT_H=1",
"-DHAVE_INTTYPES_H=1",
"-DZSTD_DISABLE_ASM=1",
"-include xlings_lua_platform_config.h",
"-include xlings_zlib_config.h",
"-DLIBARCHIVE_STATIC",
"-DPLATFORM_CONFIG_H=\\\"xlings_libarchive_config.h\\\"",
"-DHAVE_BZLIB_H=1",
"-DHAVE_LIBBZ2=1",
"-DHAVE_LZ4_H=1",
"-DHAVE_LZ4HC_H=1",
"-DHAVE_LIBLZ4=1",
"-DHAVE_ZSTD_H=1",
"-DHAVE_LIBZSTD=1",
"-DHAVE_ZSTD_compressStream=1",
"-DHAVE_ZSTD_minCLevel=1",
"-DHAVE_LZMA_H=1",
"-DHAVE_LIBLZMA=1",
"-DTUKLIB_SYMBOL_PREFIX=lzma_",
"-DHAVE_CHECK_CRC32=1",
"-DHAVE_CHECK_CRC64=1",
"-DHAVE_CHECK_SHA256=1",
"-DHAVE_ENCODERS=1",
"-DHAVE_DECODERS=1",
"-DHAVE_ENCODER_LZMA1=1",
"-DHAVE_ENCODER_LZMA2=1",
"-DHAVE_ENCODER_DELTA=1",
"-DHAVE_ENCODER_X86=1",
"-DHAVE_ENCODER_POWERPC=1",
"-DHAVE_ENCODER_IA64=1",
"-DHAVE_ENCODER_ARM=1",
"-DHAVE_ENCODER_ARMTHUMB=1",
"-DHAVE_ENCODER_ARM64=1",
"-DHAVE_ENCODER_SPARC=1",
"-DHAVE_ENCODER_RISCV=1",
"-DHAVE_DECODER_LZMA1=1",
"-DHAVE_DECODER_LZMA2=1",
"-DHAVE_DECODER_DELTA=1",
"-DHAVE_DECODER_X86=1",
"-DHAVE_DECODER_POWERPC=1",
"-DHAVE_DECODER_IA64=1",
"-DHAVE_DECODER_ARM=1",
"-DHAVE_DECODER_ARMTHUMB=1",
"-DHAVE_DECODER_ARM64=1",
"-DHAVE_DECODER_SPARC=1",
"-DHAVE_DECODER_RISCV=1",
"-DHAVE_LZIP_DECODER=1",
]
include_dirs = ["src/libs/json"]
cxxflags = ["-DLIBARCHIVE_STATIC", "-DXLINGS_USE_GTEST_MAIN=1", "-DUNICODE", "-D_UNICODE"]

[targets.xlings]
Expand All @@ -75,12 +22,11 @@ windows = "llvm@20.1.7"
toolchain = "gcc@15.1.0-musl"
linkage = "static"

[indices]
xlings = { path = "mcpp" }

[dependencies]
ftxui = "6.1.9"
"xlings.libarchive" = "3.8.7"

[dependencies.compat]
libarchive = "3.8.7"

[dependencies.mcpplibs]
cmdline = "0.0.2"
Expand Down
1 change: 0 additions & 1 deletion mcpp/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions mcpp/include/localcharset.h

This file was deleted.

Loading
Loading