Skip to content

ci: refresh stale mcpp + pkgindex pins (fix linux unit tests + windows E2E-07) - #324

Merged
Sunrisepeak merged 14 commits into
mainfrom
ci/refresh-pkgindex-mcpp-pins
Jun 19, 2026
Merged

Sunrisepeak merged 14 commits into
mainfrom
ci/refresh-pkgindex-mcpp-pins

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Why

Both xlings-ci-linux and xlings-ci-windows went red on the 2026-06-19 main push (#323), a docs-only change. The break correlates with time, not the diff: the exact same commit d6f1e7e was green on 2026-06-05, and nothing in main changed but README.

Root cause is upstream drift that landed 2026-06-08 (after the last green run) against pins that hadn't moved.

Linux — unit tests (mcpp build)

error: dependency 'compat.zlib': index entry has no `mcpp = ...` field ...

compat.zlib is an unlocked transitive dep (pulled in by compat.libarchive, which is in mcpp.lock; zlib is not). It resolves from the floating mcpp-community/mcpp-index. PR #41 there (06-08T18:47) reformatted url entries to GLOBAL/CN tables — a schema the pinned mcpp 0.0.50 (06-05, pre-#41) can't parse, so it reports the mcpp block as missing. → bump mcpp 0.0.50 → 0.0.56.

Windows — E2E-07 (Sub-Index Search)

[error] package '[email protected]' not found
[error] [d2mcpp] failed: config hook failed

d2mcpp's config hook installs d2x, which resolves to latest = 0.1.5 (released 06-08). The pinned index 34e32a0f predates that and only knows d2x ≤ 0.1.4. → bump XIM_PKGINDEX_REF → e692575 (carries d2x 0.1.5).

The index bump is required for both: the old index only offered mcpp 0.0.50; the new one offers up to 0.0.56.

Changes

  • .xlings.json: mcpp 0.0.50 → 0.0.56
  • XIM_PKGINDEX_REF: 34e32a0f → e692575 (linux/windows/macos/release workflows)
  • Fix stale # Includes mcpp 0.0.36 comments

Not a product change

No xlings binary/behavior change — shipped releases are unaffected. This is CI pin maintenance; no new xlings release is required.

Follow-up (not in this PR)

mcpp-index and sub-indexes are fetched at floating HEAD, escaping XIM_PKGINDEX_REF. A nightly canary build would surface this drift the day it happens instead of on the next unrelated push.

…ndows E2E-07)

Both CI jobs went red on the 2026-06-19 main push even though the only
change was docs. Root cause is upstream drift that landed 2026-06-08 —
after the last green run (06-05) — against pins that hadn't moved:

- Linux unit tests: `mcpp build` resolves the unlocked transitive dep
  `compat.zlib` from the floating mcpp-community/mcpp-index. PR #41
  (06-08) reformatted url entries to GLOBAL/CN tables, a schema the
  pinned mcpp 0.0.50 (06-05) can't parse → "index entry has no `mcpp`
  field". Bump mcpp 0.0.50 → 0.0.56 (parses the new schema).

- Windows E2E-07: d2mcpp's config hook installs d2x, which resolves to
  latest = 0.1.5 (released 06-08). The pinned index 34e32a0f predates
  that release and only knows d2x ≤ 0.1.4 → "package '[email protected]' not
  found". Bump XIM_PKGINDEX_REF → e692575 (carries d2x 0.1.5).

The index bump is required for both: the old index only offered mcpp
0.0.50, the new one offers up to 0.0.56. No product/binary change —
shipped xlings is unaffected; this is CI pin maintenance only.
…tion

First CI run on this branch: macОS + Windows green, Linux still hit
`compat.zlib: index entry has no mcpp field`. macOS runs the same
`mcpp build` against the same floating index and passed — the
difference is the cache.

The `Refresh mcpp package index cache` step re-fetches the mcpplibs
*index* but leaves the materialized `xpkgs/compat-x-compat.zlib`
untouched. macOS's cache key carries the `dt110` salt (cac284e);
Linux's was unsalted, so it kept restoring the last successful
(2026-06-05, pre-#41) cache whose materialized compat.zlib predates
the GLOBAL/CN url schema and lacks the `mcpp` block.

Add an `idxfmt2` salt (mirroring macOS) so the stale cache is
abandoned and compat.zlib re-materializes from the current good index.
Round-2 Linux still failed `compat.zlib: index entry has no mcpp field`
with a clean cache and mcpp 0.0.56 — so it's neither the cache nor the
mcpp version. bzip2/lz4/xz resolve fine; only zlib (the one compat lib
with a multiline `generated_files` mcpp block) loses its `mcpp = {}`
field. The local raw entry and mcpp-index HEAD both have it, and the
failure can't be reproduced locally, so the corruption is specific to
how CI repopulates the index after the bare `rm -rf mcpplibs`.

- Refresh step now runs `xlings update` to rebuild the index properly
  instead of leaving `mcpp build` to lazily (and incorrectly) repopulate
  the deleted index.
- Add a diagnostics step dumping every compat.zlib*.lua and its
  mcpp-block status, so if it still fails we see the exact entry CI uses.
Root cause (confirmed via CI diagnostics + local repro):

A fresh CI runner has no copy of mcpp-community/mcpp-index, where the
compat.* packages live. The old refresh step just did `rm -rf mcpplibs`,
leaving `mcpp build` to fetch the index lazily mid-build. That lazy fetch
drops compat.zlib's multiline `generated_files` mcpp block, so resolution
fails with "index entry has no mcpp field" — and only zlib has that
field, which is why bzip2/lz4/xz resolve fine. `xlings update` doesn't
help: it rebuilds the xim sub-indexes (scode/d2x), never mcpplibs.

Local always passed because the dev checkout already holds a raw git
clone of mcpp-index with the block intact — exactly what CI lacked.

Fix: provision mcpplibs deterministically as a raw clone pinned to
MCPP_INDEX_REF (d7191f4), matching the working local layout, and assert
the entry has its mcpp block. No mcpp/product change.
Round-4 failed because the index-provision step ran before the mcpp
sandbox existed (~/.mcpp absent until `mcpp build` first runs), so the
clone was skipped and the fail-fast assertion fired (working as intended).

Restructure into two phases inside the build step:
1. `mcpp build || true` — initialize the sandbox + materialize the
   toolchain (this pass corrupts compat.zlib via the lazy index fetch and
   is expected to fail).
2. Replace mcpplibs with a raw clone pinned to MCPP_INDEX_REF (preserves
   compat.zlib's mcpp block), assert the block is present, then build and
   test for real.

This guarantees a fully-initialized sandbox before the index is pinned,
removing the ordering dependency that broke round 4.
The Linux compat.zlib failure is rooted in mcpp's generated serialized
index cache (.xlings-index-cache.json), not the workflow: mcpp resolves
compat.zlib's build descriptor from that cache, and on a pristine CI
machine the cache is generated without zlib's `mcpp` block (zlib is the
only compat lib with a multiline `generated_files` field; bzip2/lz4/xz
are unaffected). Confirmed by: stripping the raw .lua's mcpp block does
NOT break the build (cache is the source of truth), and a pinned raw
clone with the block intact still fails (mcpp reads the cache, not the
.lua). Not reproducible locally — local always regenerates a good cache.

This needs an upstream fix in mcpp (cache serialization of multiline
strings) or mcpp-index (avoid inline multiline generated_files for
zlib), so revert the CI-side experiments and keep only the pin bumps
that fixed Windows ([email protected]) and macOS.
Per maintainer: mcpp reads the build descriptor from the raw .lua the
cache's path field points to (Fetcher::read_xpkg_lua), not from the
discovery cache. Dump that exact file on the failing CI machine to
decide xlings-sync truncation vs mcpp parser. Revert after capture.
…p parser

Decisive finding: on the failing CI runner the compat.zlib.lua mcpp
opens (per the index cache's path field) is byte-identical to upstream
HEAD (sha256 cfb31c61…, 2479 bytes, 69 lines) and to a local checkout,
and the mcpp 0.0.56 binary is the same release tarball. Local parses it
and builds; CI reports 'index entry has no mcpp field'. Same binary +
same bytes, different result → environment-sensitive mcpp parser
behavior on compat.zlib's generated_files block (the only compat lib
with one; bzip2/lz4/xz lack it and resolve fine). Not xlings sync (file
is byte-perfect), not the [[ long-bracket case (uses "...\n").

Reverting CI experiments; PR keeps only the pin bumps that fixed
Windows ([email protected]) and macOS. Linux unit build needs an mcpp-side fix.
…xpkg_lua)

Maintainer root-caused the compat.zlib unit-build failure: mcpp's
read_xpkg_lua scans ~/.mcpp/registry/data/* with directory_iterator
(unspecified order) and, for (ns=compat, name=compat.zlib), falls back
to a bare zlib.lua candidate. That collides with
xim-pkgindex/pkgs/z/zlib.lua (upstream xim:zlib, no mcpp block); on
ubuntu-24.04 runners xim-pkgindex is iterated before mcpplibs, so the
wrong file is selected → 'index entry has no mcpp field'. Only zlib
collides (bzip2/lz4/xz have no bare-name pkg in a direct child index),
which matches the observed selectivity, and explains why the sha256 of
the mcpplibs file matched yet the build still failed (mcpp opened a
different file).

Workaround: after materializing the index, remove the colliding bare
zlib.lua from non-mcpplibs indexes so the namespaced compat.zlib.lua is
selected deterministically. Real fix belongs in mcpp read_xpkg_lua.
The bare-zlib.lua removal made the unit build pass (confirming the
read_xpkg_lua cross-index ambiguity is the root cause), but the same
collision recurs in every isolated mcpp home the E2E suite creates
(E2E-00 etc.), and xim:zlib is a legitimate package so the bare entry
can't be removed at the index source. The clean fix is in mcpp
read_xpkg_lua (prefer the exact namespaced compat.zlib.lua over the
bare-name fallback). Keep this PR to the pin bumps that fixed Windows
([email protected]) and macOS; Linux turns green once mcpp ships the fix and we
bump the pin.
mcpp 0.0.57 fixes the read_xpkg_lua cross-index ambiguity that selected
the bare xim-pkgindex zlib.lua over the namespaced compat.zlib.lua,
failing the Linux unit build and every isolated-home mcpp build with
"compat.zlib: index entry has no mcpp field".

- .xlings.json: mcpp 0.0.56 -> 0.0.57
- XIM_PKGINDEX_REF -> fbcad032 (carries mcpp 0.0.57; still has d2x 0.1.5
  for the Windows sub-index test)
@Sunrisepeak
Sunrisepeak merged commit ca25ab7 into main Jun 19, 2026
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