Skip to content

[bug] 项目级 index repo ≥2 个时 xlings install_packages 静默失败(挡死 workspace 根级 [indices] 继承 + default 重定向组合) #238

Description

@Sunrisepeak

现象

同一工程的 .mcpp/.xlings.json 里注册 两个及以上 项目级 index repo 时,
xlings interface install_packages 对任意包安装静默失败:NDJSON 只有
{"exitCode":1,"kind":"result"},无任何 error 事件;mcpp 侧只能报出
error: fetch '<pkg>@<ver>' failed (exit 1),完全无法定位。

单 repo 一切正常。与 repo 名是否为内建 mcpplibs、URL 是否相同均无关:

index_repos 安装 compat:compat.imgui@1.92.8 结果
[compat] ✓ exit 0
[mcpplibs](装 mcpplibs:… 包) ✓ exit 0
[compat, mcpplibs](同 URL) ✗ 静默 exit 1
[compat, fmtlib](同 URL,无 mcpplibs) ✗ 静默 exit 1
[compat, mcpplibs](不同 URL) ✗ 静默 exit 1

复现(xlings 0.4.62,mcpp 0.0.97 发行包 vendored 同版本):

# 沙箱:XLINGS_PROJECT_DIR 下 .xlings.json 含两个 path repo(指向任意含 pkgs/ 的本地索引)
cd ~/.mcpp/registry && env PATH="$HOME/.mcpp/registry/subos/default/bin:$PATH" \
  XLINGS_HOME=$HOME/.mcpp/registry XLINGS_PROJECT_DIR=<sandbox> \
  ~/.mcpp/registry/bin/xlings interface install_packages \
  --args '{"targets":["compat:compat.imgui@1.92.8"],"yes":true}'
# → {"exitCode":1,"kind":"result"}   (无任何 error 事件)

触发路径与影响

mcpp 0.0.97 起 workspace 根级 [indices] 会被成员继承(#224)——mcpp-index 仓根一次
声明 default/compat/fmtlib/marzer/nlohmann 五个命名空间后,每个成员的 .xlings.json
都有 5 个 repo,所有未缓存包的安装全部失败。这实质上把 #224 的根级集中化 + R6 的
default 重定向组合用法(mcpp-index 的目标形态)挡死了:目前只能退回"每成员单命名空间
声明"(单 repo 恰好能用)。

期望

  1. 多项目级 index repo 正常工作(mcpp-index 的成员天然需要 default + compat 组合);
  2. 失败时至少发一个 error 事件(kind:"error", message),不要裸 exitCode=1——
    这次定位花了一整轮二分,全部信息只有一个数字。

环境

xlings 0.4.62(mcpp 0.0.97 vendored)· linux x86_64

Activity

  1. added 6 commits that reference this issue on Jul 18, 2026
  2. Sunrisepeak commented on Jul 18, 2026

    @Sunrisepeak
    MemberAuthor

    Status (0.0.98): mcpp-side diagnostics landed — the opaque fetch failed (exit 1) is now an actionable message (target, configured index-repo list, the ≥2-repo gap hint, retained child output, MCPP_VERBOSE=1). The root cause is NOT in mcpp — the multi-repo resolution fix must land in xlings, tracked in openxlings/xlings#374. Keeping this open until xlings#374 is resolved (per the no-workaround discipline — mcpp diagnostics ≠ a fix).

  3. Sunrisepeak commented on Jul 19, 2026

    @Sunrisepeak
    MemberAuthor

    Resolved in mcpp 0.0.99 (released + indexed).

    The root cause was in xlings (openxlings/xlings#374), now fixed upstream (fix(xim): surface multi-repo install failures + best-effort catalog, commit cf9b60d5, shipped in xlings 0.4.67). mcpp 0.0.99 vendors/bundles xlings 0.4.67 (release + cross-build + e2e workflow pins bumped 0.4.62 → 0.4.67), and 0.0.98's mcpp-side diagnostics remain.

    Live A/B (≥2 index_repos, same environment):

    • xlings 0.4.62: {"exitCode":1,"kind":"result"} — silent exit 1, zero diagnostics (the bug).
    • xlings 0.4.67: structured error event — {"code":"E_NOT_FOUND","hint":"searched repos: [...]","kind":"error","message":"..."} — multi-repo failures are now surfaced, exactly as this issue requested.

    The xim-pkgindex install-tests (linux/macos/windows) for the 0.0.99 bump ran real multi-repo installs and passed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions