Skip to content

fix: payload discovery must skip delegating-package husks (#120)#121

Merged
Sunrisepeak merged 2 commits into
mainfrom
fix/linux-headers-husk-discovery
Jun 5, 2026
Merged

fix: payload discovery must skip delegating-package husks (#120)#121
Sunrisepeak merged 2 commits into
mainfrom
fix/linux-headers-husk-discovery

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Fixes #120 (ci-linux e2e 29_toolchain_partial_versions.sh / 31_transitive_deps.sh failing on main).

Root cause (forensics)

  1. Why it never failed before: green runs restored a warm 5.2 GB ~/.mcpp cache holding an anciently-installed, complete toolchain — the cold first-run install path was never exercised. The old cache got evicted; the next run's bare restore prefix mcpp-sandbox-Linux- then matched release.yml's mcpp-sandbox-Linux-release-… cache (different sandbox flavor), and the run finally hit the true cold path.
  2. The actual bug: xim:linux-headers is a delegating package — the payload installs under scode-x-linux-headers/…, while xim-x-linux-headers/<v>/ is left as a metadata-only husk (.xim-installed + .xpkg.lua). find_sibling_package counted .xpkg.lua as content, returned the husk, and probe_payload_paths silently dropped the kernel-header include dir → glibc's bits/local_lim.h fails at #include <linux/limits.h> in the std-module precompile.
  3. find_home_tool (the fallback) was worse: hardcoded xim-x- prefix, no content validation — it also returned the husk.

Fix

  • Payload qualification helper shared by both finders: dot-prefixed entries are install metadata, not content; an optional requiredRelPath must exist inside the version dir (probe passes include/linux/limits.h / include/features.h).
  • find_home_tool now scans all index prefixes (xim-x-, scode-x-, …) with the same rules.
  • Probe logs a verbose warning instead of silently proceeding without kernel headers.
  • CI cache hygiene: -ci- cache lineage for ci-linux/ci-windows, disjoint from release's -release-; release no longer falls back to the bare prefix either.

Verification

  • 4 new unit tests (XlingsSiblingPackage.*, XlingsHomeTool.*): husk-only → no match; husk + scode payload → scode payload wins; contentful-but-wrong candidate rejected via requiredRelPath; non-xim prefix found via home lookup. Full suite 18/18.
  • Local e2e 29/31 pass (host environment masks the cold path, so the discriminating coverage is the unit layer).
  • The cache key change makes this PR's ci-linux run fully cold — it exercises the exact first-run install path that broke on main, so a green run here is the end-to-end proof.

A delegating index package (xim:linux-headers -> scode:linux-headers)
leaves a metadata-only husk (.xim-installed + .xpkg.lua) under its own
prefix; find_sibling_package counted .xpkg.lua as content, returned the
husk, and probe_payload_paths silently dropped the kernel-header include
path -- every glibc toolchain build then died at <linux/limits.h>
(e2e 29/31 on a cold sandbox).

- payload qualification: dot-prefixed entries are metadata, not content;
  optional requiredRelPath must exist in the version dir
- find_home_tool: search across all index prefixes (was hardcoded xim-x-)
  with the same qualification rules
- probe: require include/linux/limits.h (linux-headers) and
  include/features.h (glibc fallback); log when no payload qualifies
- CI cache hygiene: give ci-linux/ci-windows sandbox caches a '-ci-'
  lineage disjoint from release's '-release-' caches; a bare restore
  prefix used to swap in the release-flavored sandbox, which is what
  exposed this cold-path bug on main
@Sunrisepeak Sunrisepeak merged commit 55ea380 into main Jun 5, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the fix/linux-headers-husk-discovery branch June 5, 2026 11:30
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.

ci-linux e2e 29/31 fail deterministically: gcc@16.1.0 first-run install — glibc 2.39 xpkg missing linux/limits.h

1 participant