Repository navigation
fix(xvm): materialize the group's declared headers, not one member's includedir - #406
Merged
Merged
Conversation
…includedir `bindingHeaders` records every header directory a release declares, on the group root, and #384 serialized it, parsed it, validated it and round-tripped it through the version database. Nothing ever read it. Materialization went through `VData::includedir` instead -- a single string the installer writes on the root with last-op-wins semantics. For a release declaring one header directory the two agree. For one declaring two they do not: install materializes both, because it walks the effect list, while `xlings use` only ever remembers the last. Switching away left the other directories' headers in the sysroot and switching in never brought the new release's copies. The sysroot held a mix of two releases -- the exact state the binding-group work exists to make unrepresentable, reached through the header path instead of the member path. `xvm::group_header_assets(db, target, version)` resolves any member of a release to the group's declared list, falling back to `includedir` when there is none -- 0.4.69 state has no `bindingHeaders`, and neither does a registration outside a provider group. The switch planner, the removal teardown and the removal fallback all go through it. Header assets also move from MemberSwitch to UseSwitchPlan, because they belong to the release rather than to any member of it. Per-member lists would link the same directory once per member, and -- worse -- the loop applied them one member at a time, so member B's removal of the outgoing release could delete links member A had just installed for the incoming one, for every header name the two versions share. Which, for two versions of one toolchain, is all of them. The plan now carries the two lists deduplicated and disjoint, and `cmd_use` applies all removals before any install. `destinationPrefix` is honored too. No recipe can set it today -- libxpkg's `xvm.setup` takes a bare `includedir` -- but it is part of the persisted model and round-trips, and a serialized field materialization ignores is what this change is removing, not adding. `attach_legacy_header_dir` still writes `includedir`, now for one reason only: 0.4.69 switches headers by reading it and knows nothing about `bindingHeaders`, so dropping it would make a downgrade silently stop moving headers. The release notes promise the rollback is safe. Reachability, stated plainly: no recipe in the official index declares header directories at all, and `xvm.setup` can only declare one per call (a second call is refused as a duplicate registration). So the multiplicity this fixes is currently unreachable through the public recipe API. The E2E fixture pushes the second op onto `_XVM_OPS` directly to exercise it. Verified: 6 new unit cases (XvmGroupHeaders) + 2 for the destination prefix; E2E-32 extended with a second header directory. Reverting the resolver fails 3 of the unit cases and E2E-32 scenario 2, which reports the sysroot holding 1.0.0's `include/` while the workspace and `include-fixed/` are on 2.0.0.
3 tasks
Sunrisepeak
added a commit
that referenced
this pull request
Aug 10, 2026
… costs The cross-build lane went red on main, not just here. mcpp 2026.8.10.1's host toolchain post-install fixup binds `[email protected]` while the resolver installs 2.44 -- latest since xim-pkgindex#582 -- and refuses to fall back. Established by re-running ONE unchanged run id across the index bump that made mcpp 2026.8.10.1 latest (xim-pkgindex#588, 01:55Z): the same commit passed with mcpp 2026.8.8.4 at 19:09 and failed with 2026.8.10.1 at 03:41. Same workflow, same runner image. Also reproduces locally against UNMODIFIED libxpkg 0.0.55, which is what rules out this branch as the cause. Filed as mcpp-community/mcpp#406. The pin is temporary and it is not free: this job takes the latest mcpp on purpose, to be the canary for exactly this. Pinning it muzzles the canary, so the comment names the removal condition rather than sitting there as an unexplained version. Until #406 lands, breakage against the newest mcpp is invisible on this lane. Also adds the 2026.8.10.2 release notes.
Sunrisepeak
added a commit
that referenced
this pull request
Aug 10, 2026
…it cannot (2026.8.10.2) (#526) * fix(deps): a cold home can install gcc again, and CI can see it when it cannot (2026.8.10.2) 2026.8.10.1 began filling `dependency_store_roots` on every install, and shipped libxpkg 0.0.55 in the same release. Either alone is inert; together they executed a path where `dep_install_dir` gated on how specific the QUERY was rather than on whether the ANSWER was unique. Six of the seven call sites in xim-pkgindex returned nil: gcc and meson could not install on any cold home -- new machines, cold CI caches, `fresh-install`, and every downstream mcpp build -- while godot silently fell back to the host's GL and the graphics banner reported `unknown`. The fix is libxpkg 0.0.56 (`resolved_dep` judges ambiguity, which its own uniqueness guard already decided, and matches the version half as the RANGE a recipe actually writes). This commit takes that dependency and adds the thing that was missing on this side: a way to notice. **E2E-79, and why it has to be cold.** A warm home skips the install, so the config hook never runs -- which is exactly why every lane here stayed green while the released binary could not install a toolchain. The first detector was a downstream repo's cache miss. This test is that detector, in-tree: a consumer declares a namespaced ranged coordinate, the resolver places the dependency, and the hook must find it. Verified against both builds -- it fails on libxpkg 0.0.55 with "this is #524" and passes on 0.0.56. It also pins the other half of the contract, with a second consumer that asks for something it never declared: that must fail, name the coordinate, and say it is not a declared dependency. "Cannot answer" and "is not installed" made the same nil for a whole release, and that is what sent the bug report looking for a missing glibc that was sitting on disk. **`.agents/tools/repro-dep-install-dir.sh`** replays all seven real call shapes against any libxpkg revision offline -- no network, no install, no home touched. It reads the file out of git, and takes `worktree` for an uncommitted one, because otherwise a fix that is not yet committed tests as if it did not exist. Root cause, blast radius and the #525 analysis: `.agents/docs/2026-08-10-issue-524-525-root-cause-and-fix-design.md` Task graph and cross-repo order: `.agents/plans/2026-08-10-issue-524-525-implementation.md` Refs #524, #525 * ci(aarch64): pin mcpp to 2026.8.8.4 until mcpp#406, and say what that costs The cross-build lane went red on main, not just here. mcpp 2026.8.10.1's host toolchain post-install fixup binds `[email protected]` while the resolver installs 2.44 -- latest since xim-pkgindex#582 -- and refuses to fall back. Established by re-running ONE unchanged run id across the index bump that made mcpp 2026.8.10.1 latest (xim-pkgindex#588, 01:55Z): the same commit passed with mcpp 2026.8.8.4 at 19:09 and failed with 2026.8.10.1 at 03:41. Same workflow, same runner image. Also reproduces locally against UNMODIFIED libxpkg 0.0.55, which is what rules out this branch as the cause. Filed as mcpp-community/mcpp#406. The pin is temporary and it is not free: this job takes the latest mcpp on purpose, to be the canary for exactly this. Pinning it muzzles the canary, so the comment names the removal condition rather than sitting there as an unexplained version. Until #406 lands, breakage against the newest mcpp is invisible on this lane. Also adds the 2026.8.10.2 release notes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the second of the two gaps recorded during the PR #402 architecture review. Stacked on #405 conceptually but touches disjoint files.
The problem
bindingHeadersrecords every header directory a release declares, on the group root. #384 serialized it, parsed it, validated it, and round-tripped it through the version database.Nothing ever read it.
Materialization went through
VData::includedirinstead — a single string the installer writes on the root with last-op-wins semantics:xlings useSo switching away left the other directories' headers in the sysroot, and switching in never brought the incoming release's copies. The sysroot ended up holding a mix of two releases — the exact state the binding-group work exists to make unrepresentable, reached through the header path rather than the member path.
The fix
xvm::group_header_assets(db, target, version)resolves any member of a release to the group's declared list, falling back toincludedirwhen there is none (0.4.69 state has nobindingHeaders; neither does a registration outside a provider group). The switch planner, the removal teardown and the removal fallback all go through it.Headers move from
MemberSwitchtoUseSwitchPlanThey belong to the release, not to any member of it. Per-member lists would be wrong twice:
The plan now carries
removeHeadersandinstallHeadersdeduplicated and disjoint, andcmd_useapplies all removals before any install. An asset both releases need is never removed at all — which matters becauseusere-materializes the active release on every call to repair a drifted sysroot, and remove-then-relink would open a missing-header window on every one of those calls.destinationPrefixis honored<sysroot>/include/<prefix>rather than flattening into the include root, and an emptied prefix directory is cleaned up (viaremove, so it cannot take a directory it does not own).includediris still writtenNow for exactly one reason: 0.4.69 switches headers by reading it and knows nothing about
bindingHeaders. Dropping it would make a downgrade silently stop moving headers, and the release notes promise the rollback is safe. It records only the last declared directory — which is the limitation 0.4.69 already had, so a downgrade gets the old behavior back, not a worse one.Reachability, stated plainly
No recipe in the official index declares header directories at all, and
xvm.setupcan only declare one per call — calling it twice is refused as a duplicate registration (correctly, by #384's registration layer). So the multiplicity this fixes is currently unreachable through the public recipe API.It is still worth fixing: the field is persisted, validated and round-tripped today. Leaving it unconsumed is the next "written but never read" value, and the first recipe that needs two header directories would hit a silent half-switch instead of an error.
The E2E fixture pushes the second
headersop onto_XVM_OPSdirectly to exercise the path.Verification
XvmGroupHeaders) + 2 for the destination prefixinclude/andinclude-fixed/, both version-stamped, and every scenario asserts both movedsysroot header is '1.0.0', expected '2.0.0'— the workspace andinclude-fixed/on 2.0.0 whileinclude/stayed on 1.0.0, i.e. the split this PR removesAlso in this PR
Release-notes update covering both review findings (this one and #405's lock coverage), including the honest note about reachability above.