feat(xim): XPackage V2 multi-arch install-time resolution (0.4.61)#346
Merged
Conversation
Resolve CPU architecture as a first-class, install-time dimension (V2),
consuming libxpkg 0.0.42's per-arch resource fields.
- installer.cppm: parse the 3 V2 shapes in the sandbox loader (per-arch map,
URL template + per-arch sha256, res+sha256); resolve the host arch at
install time (mirrors XLINGS_RES) via mcpplibs::xpkg::normalize_arch;
expand_url_template_ for ${name}/${version}/${os}/${arch}/${arch_alias}/${ext};
fail-closed validation of host arch against package.archs (catches the
silent mis-install where an x86_64-only recipe ran on aarch64).
- mcpp.toml/mcpp.lock: bump mcpplibs.xpkg dependency 0.0.41 -> 0.0.42.
Reuses libxpkg's normalize_arch/ArchResource (single source of truth, two
loaders kept in lockstep). Builds green via mcpp against libxpkg 0.0.42.
- .agents/docs: analysis+comparison (Nix/Cargo/xmake) design report and the cross-repo implementation plan. - .xlings.json: unify mcpp toolchain pin to latest 0.0.67.
Ships XPackage V2 multi-arch support (libxpkg 0.0.42). Also syncs the mcpp.toml version (was drifted at 0.4.59) with config.cppm.
The bootstrap package-index ref must contain the mcpp version pinned in .xlings.json. Pinning mcpp 0.0.67 requires an index ref that has it; the previous fbcad03 only had 0.0.57.
mcpp 0.0.67 no longer auto-links gtest_main for test targets, so the define (which suppressed test_main.cpp's own main) left 'undefined reference to main'. Letting test_main.cpp provide main works across the pinned toolchain (verified: mcpp test builds + runs, 9/10 unit suites pass locally; the mirror suite needs a populated XLINGS_HOME).
V1 recipes' `archs` was never enforced and is often under-declared
(e.g. an x86_64-only list on a recipe that resolves an aarch64 asset via
XLINGS_RES). Enforcing it broke installs on aarch64 hosts (macOS arm64 CI:
fixture ninja archs={x86_64} was rejected -> XLINGS_RES archive missing).
Only V2 recipes (which opt into correct per-arch declarations) are gated.
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.
What
Resolve CPU architecture as a first-class, install-time dimension (XPackage V2), consuming libxpkg 0.0.42's per-arch resource fields. Fixes the silent mis-install where an x86_64-only recipe would be attempted on an aarch64 host (and vice-versa).
Changes
installer.cppm: parse the three V2 shapes in the sandbox loader (per-arch map, URL template + per-arch sha256,res+sha256); resolve the host arch at install time (mirrors XLINGS_RES) viamcpplibs::xpkg::normalize_arch;expand_url_template_for${name}/${version}/${os}/${arch}/${arch_alias}/${ext}; fail-closed validation of host arch againstpackage.archs.mcpp.toml/mcpp.lock: bumpmcpplibs.xpkg0.0.41 → 0.0.42..xlings.json: pin mcpp to latest 0.0.67.mcpp.tomlversion)..agents/docs: design report (Nix/Cargo/xmake comparison) + implementation plan.Reuses libxpkg's
normalize_arch/ArchResource— single source of truth, both xpm loaders kept in lockstep.Verification
Builds green via mcpp against libxpkg 0.0.42 (built from source);
xlings --versionruns. libxpkg side: 17/17 loader+arch tests pass.CI
mcpp buildwill be red until libxpkg 0.0.42 is published to mcpp-index. Order:v0.0.42→ publish to mcpp-index.mcpp update xpkghere (refreshesmcpp.lockhash) → CI green → un-draft → merge.Releaseworkflow (workflow_dispatch) to cutv0.4.61+ publish index artifacts.Companion recipe PR (xim-pkgindex): V2 spec + github-gh/node arch-bug fixes (Gitee).
🤖 Generated with Claude Code