Skip to content

ci: pin refresh on main (control experiment — do not merge) - #404

Closed
Sunrisepeak wants to merge 1 commit into
mainfrom
ci/pin-refresh-on-main
Closed

Sunrisepeak wants to merge 1 commit into
mainfrom
ci/pin-refresh-on-main

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

对照实验,不要合并。

与 #403 完全相同的 pin 刷新(mcpp 0.0.67→0.0.108、XIM_PKGINDEX_REF、bootstrap v0.4.69),但打在 origin/main 上,不含任何 0.4.70 的工作。

目的:#403 上 [email protected] 报 E_NOT_FOUND,而该包在上游索引里确实存在,且 mcpplibs 子索引 artifact 下载成功 —— 但 catalog 构建时一条 mcpplibs:: 都没列出来。

catalog.cppm 在 0.4.70 的改动范围内,所以必须排除是发布分支引入的。

  • 本 PR 通过 → 问题在发布分支
  • 本 PR 同样失败 → 问题在 pin/上游侧,与 0.4.70 无关

验证完即关闭。

Same mcpp / pkgindex / bootstrap pin refresh as #403, on top of
origin/main with none of the 0.4.70 work. If this passes and #403 does
not, the remaining failure is in the release branch, not the pins.
Sunrisepeak added a commit that referenced this pull request Jul 26, 2026
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.
@Sunrisepeak

Copy link
Copy Markdown
Member Author

对照完成,结论已取得:同样的 pin 打在纯 main 上同样失败(1/7),与 #403 一致 —— 排除了 0.4.70 的全部改动。

后续在 #403 上切到 mcpp 0.0.109 后,依赖解析恢复正常,CI 首次跑到测试阶段并暴露出一个真实的 macOS 路径断言缺陷(已修)。本对照分支不再需要。

@Sunrisepeak
Sunrisepeak deleted the ci/pin-refresh-on-main branch July 26, 2026 12:25
Sunrisepeak added a commit that referenced this pull request Jul 26, 2026
* ci: refresh the mcpp and package-index pins

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.

* ci: bootstrap with a recent xlings, not v0.4.49

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.

* ci: move to mcpp 0.0.109

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.

* test: compare where paths point, not how they are spelled

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.

* test: stop assuming POSIX in the Windows-visible cases

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.

* fix(xvm): let a recipe's hook call xlings while the lock is held

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.

* docs: note the build toolchain requirement in the release notes

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.
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