Skip to content

feat(xim): XPackage V2 multi-arch install-time resolution (0.4.61)#346

Merged
Sunrisepeak merged 7 commits into
mainfrom
feat/xpm-v2-multiarch
Jun 26, 2026
Merged

feat(xim): XPackage V2 multi-arch install-time resolution (0.4.61)#346
Sunrisepeak merged 7 commits into
mainfrom
feat/xpm-v2-multiarch

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

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) 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.
  • mcpp.toml/mcpp.lock: bump mcpplibs.xpkg 0.0.41 → 0.0.42.
  • .xlings.json: pin mcpp to latest 0.0.67.
  • release: bump to 0.4.61 (also syncs the drifted mcpp.toml version).
  • .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 --version runs. libxpkg side: 17/17 loader+arch tests pass.

⚠️ Sequencing (why draft)

CI mcpp build will be red until libxpkg 0.0.42 is published to mcpp-index. Order:

  1. Merge feat(xpkg): V2 multi-arch xpm schema + arch normalization (0.0.42) libxpkg#25 → tag v0.0.42 → publish to mcpp-index.
  2. mcpp update xpkg here (refreshes mcpp.lock hash) → CI green → un-draft → merge.
  3. Run the Release workflow (workflow_dispatch) to cut v0.4.61 + publish index artifacts.

Companion recipe PR (xim-pkgindex): V2 spec + github-gh/node arch-bug fixes (Gitee).

🤖 Generated with Claude Code

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.
@Sunrisepeak Sunrisepeak merged commit e708a03 into main Jun 26, 2026
7 checks passed
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