Skip to content

ci: refresh the mcpp and package-index pins - #403

Merged
Sunrisepeak merged 7 commits into
release/0.4.70from
ci/refresh-mcpp-pin
Jul 26, 2026
Merged

Sunrisepeak merged 7 commits into
release/0.4.70from
ci/refresh-mcpp-pin

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

修 R.3 门禁的真正阻塞。不是网络问题 —— 我先前的诊断是错的。

根因

mcpplibs 索引声明了客户端版本下限:

# index.toml
min_mcpp = "0.0.108"

CI 钉的是 mcpp 0.0.67,所以任何需要新鲜索引解析的包都被门禁挡掉。

关键在于:E0006 这个 floor 检查是 mcpp 0.0.85 才引入的,而 0.0.67 早于它 —— 所以被钉的客户端根本不会报告违规,只是解析失败,抛出一条长得像下载失败的消息。我就是被这条消息骗了。

排除网络的证据

观察 结论
同一个 job 里 glibc 35.9MB @ 22MB/s、gcc 96.8MB @ 43MB/s 网络正常
gtest 源就在 github.com,本地 HTTP 200 / 2.4s CI 跑在 GitHub 上,不可能不通
失败瞬间发生,无任何传输进度 失败在解析,不在传输
mcpp build 成功(250s,943/943) 生产依赖全从 payload 缓存复用,无需解析
只有 gtest(dev-dep,缓存无)和 musl e2e 路径的 compat.bzip2 失败 只有真正需要索引的才撞门禁

修复

项 之前 之后
.xlings.json mcpp 0.0.67 0.0.108
XIM_PKGINDEX_REF(6 个 workflow) dee7848… aa48bec…(已验证含 mcpp 0.0.108)

两者必须同时改 —— 索引注释写明 "Bump min_mcpp ONLY together with the CI MCPP_VERSION pin",且 #324 曾为同一类问题刷新过这两个 pin。

xlings-ci-aarch64 不钉索引 ref(它从源码自建 cross-capable mcpp),未改动,观察其表现。

风险

从 0.0.67 跳到 0.0.108 是 41 个版本。历史上这类 bump 有过 gotcha(gtest_main、mirror-test)。这正是要在 CI 上验证的原因 —— 本机 mcpp 是 0.0.103,同样低于 floor,验证不了这件事。

若 CI 暴露新问题,在本 PR 上迭代,不污染集成分支。

Every workflow has been failing on lines like

  error: fetch '[email protected]' failed (exit 1)
  error: fetch '[email protected]' failed (exit 1)

which read as a network problem and are not one. The mcpplibs index
declares a client floor:

  # index.toml
  min_mcpp = "0.0.108"

CI pinned mcpp 0.0.67, so every fresh index resolution is gated out. The
floor check (E0006) landed in mcpp 0.0.85, and 0.0.67 predates it, so
the pinned client does not even report the violation -- it just fails to
resolve, with a message that looks like a failed download.

Everything else in the evidence agrees: the runners download glibc at
22 MB/s and gcc at 43 MB/s in the same job, github.com serves the gtest
tarball fine, the failures are instant with no transfer, and     Finished release [optimized] in 0.01s
succeeds outright because its dependencies come from the restored
payload cache. Only what actually needs the index -- gtest, a
dev-dependency absent from the cache, and compat.bzip2 on the musl e2e
path -- hits the gate.

Bump mcpp to 0.0.108 and XIM_PKGINDEX_REF to a commit that carries it.
The two move together: the index comment spells out that min_mcpp is
bumped only alongside the client pin, and #324 refreshed both for the
same class of breakage before.

aarch64 pins no index ref -- it self-hosts a cross-capable mcpp from
source -- so it is left alone and observed.
Refreshing the mcpp pin moved the failure and improved its diagnosis:

  before  error: fetch '[email protected]' failed (exit 1)
  after   error: xlings install_packages failed (exit 1) for '[email protected]'
          with 1 index repo configured [mcpplibs -> .../mcpp-index.git]
          xlings emitted no structured error

mcpp 0.0.108 delegates package installation to xlings, and it is xlings
that fails. The bootstrap was pinned at v0.4.49, which predates 0.4.52 --
the release that moved index fetching to versioned artifacts. So the
bootstrap cannot install from the current index at all.

That also explains the shape of the failures:     Finished release [optimized] in 0.01s succeeds
because production dependencies come from the restored payload cache,
and only what genuinely needs installing -- gtest, absent from the cache
-- reaches the broken path.

Bootstrap with v0.4.69, the current release. aarch64 was on 0.4.51 and
failing the same way; it moves too, so all seven workflows now bootstrap
from one version instead of three.
0.0.109 landed today. Take it rather than 0.0.108: the index floor is
0.0.108, so 0.0.109 satisfies it, and the failure seen on 0.0.108 --
xlings fetching the mcpplibs sub-index artifact successfully and then
finding none of its packages in the catalog -- is worth retesting
against the newer client before digging further into it.

Repins XIM_PKGINDEX_REF to a commit carrying 0.0.109, and the pin
comment with it.

That failure is not from this release branch: the same pins applied to
plain origin/main fail identically (1/7, #404), so it is pre-existing.
With dependency resolution working under mcpp 0.0.109, the suite ran far
enough to surface a real failure -- on macOS only:

  xvm registration production child: project metadata and artifact roots
  disagree   (exit 6)

The production-path child builds its expectations from
fs::temp_directory_path() while Config discovers the project root by
walking up from the working directory. On macOS the temp dir lives under
/var, a symlink to /private/var, so the two spellings differ while
naming one directory. The global-scope check passed because the test
hands Config that path directly; only the discovered project path takes
the symlinked route.

Compare through weakly_canonical. This is a defect in the assertion, not
in the product: nothing outside the test compares these two spellings,
and every path the product builds comes from Config consistently.

It was invisible until now because every earlier CI run died during
dependency resolution, before any test executed.
With CI finally reaching the test phase, Windows surfaced six failures.
All six are assumptions in tests, not defects in the product.

Four are the same one: cleanup calls remove_all on a directory whose
file is still open. POSIX lets you unlink an open file; Windows does
not, so the cleanup throws and the failure message says nothing about
what was under test. The three state-lock tests now scope their lock
and, like the late-conflict test, remove with the error_code overload.

One compares a path against a POSIX literal. The value is built with
std::filesystem::path, so on Windows it comes back with backslashes and
the literal can never match. Build the expectation the same way.

One checks for a shim by bare name. Program shims carry the platform's
executable suffix, so the bare name only exists on POSIX.

The production-path child also moved from exit 6 to exit 10 with the
previous canonicalization fix, which is progress: the root comparison
now passes and the next check is the one failing.

None of this was visible before today -- every earlier CI run died
during dependency resolution, so no test on any platform had run.
The state lock deadlocked against xlings itself. Recipes shell out to
xlings from their hooks -- d2mcpp's config hook runs `xlings install` --
and the child waited 30 s for a lock its own parent was holding and
could not release until the child returned:

  [error] another xlings process is changing this installation; waited 30s
  [warn]  config hook failed for d2mcpp: exec failed: xlings install ...

A real defect I introduced, not a platform quirk. It surfaced on the
Windows e2e only because that is the job whose fixture exercises a
recipe with a nested install.

Make the lock re-entrant across a process tree. The holder exports
XLINGS_STATE_LOCK_HELD; a descendant sees it, skips locking, and
proceeds under the lock its ancestor already holds. The marker is
cleared when the holder is destroyed, so an unrelated later command in
the same process still locks normally.

SecondAcquisitionInTheSameProcessFailsFast asserted the premise this
change removes -- within one process, re-entry is now the intended
behavior. Replaced with AnUnrelatedHolderIsExcludedWithAnActionableMessage,
which clears the marker to stand in for a process that shares nothing but
the home, and a case pinning that a child never waits and that the marker
does not outlive its holder.
The mcpp pin moved 0.0.67 -> 0.0.109. That changes nothing for people
using xlings -- the binary release does not need mcpp -- but anyone
building from source has to move with it, and the notes said nothing.

Includes why, because the failure mode is misleading: the mcpplibs index
raised its client floor to 0.0.108, and an mcpp older than 0.0.85 does
not implement the floor check at all, so it reports a resolution failure
as `error: fetch '<pkg>' failed` and looks like a network problem.
@Sunrisepeak
Sunrisepeak merged commit 91cd766 into release/0.4.70 Jul 26, 2026
7 checks passed
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.

1 participant