Skip to content

feat(xpkg): V2 multi-arch xpm schema + arch normalization (0.0.42)#25

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

feat(xpkg): V2 multi-arch xpm schema + arch normalization (0.0.42)#25
Sunrisepeak merged 3 commits into
mainfrom
feat/xpm-v2-multiarch-main

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

What

Make CPU architecture a first-class, declarative dimension of the xpm schema (V2). A version-entry value may now be:

  • per-arch map{ x86_64 = {url,sha256}, aarch64 = {...} }
  • URL template + per-arch sha256{ url="...${arch}...", sha256={...}, arch_alias={...} }
  • res = true + per-arch sha256 — XLINGS_RES auto-URL, now with checksums

All legacy single-arch shapes parse unchanged. The loader stores the raw, arch-agnostic data; the host arch is resolved at install time (xlings side).

Changes

  • xpkg.cppm: normalize_arch()/arch_matches() (arm64↔aarch64, amd64↔x86_64); ArchResource; PlatformResource gains archs/sha256_by_arch/arch_alias/is_res.
  • xpkg-loader.cppm: parse the three new shapes; fix a latent leak where the platform-level exports table was parsed as a bogus version entry.
  • tests: 6 new GoogleTest cases (per-arch map, template, res, legacy-unchanged, arch normalization). 17/17 loader+arch tests pass.
  • bump to 0.0.42; pin mcpp to latest 0.0.67.

Downstream

Consumed by openxlings/xlings (XPackage V2 install-time resolution). After merge: tag v0.0.42, publish to mcpp-index, then bump xlings' mcpplibs.xpkg pin to 0.0.42.

🤖 Generated with Claude Code

Add architecture as a first-class, declarative xpm dimension (V2). A
version entry value may now be:
  - per-arch resource map:   { x86_64={url,sha256}, aarch64={...} }
  - URL template + per-arch sha256: { url="...${arch}...", sha256={...}, arch_alias={...} }
  - XLINGS_RES + checksums:  { res=true, sha256={x86_64=,aarch64=} }
All legacy single-arch shapes parse unchanged. The loader keeps the raw,
arch-agnostic data; host arch is resolved at install time (xlings side).

- xpkg.cppm: normalize_arch()/arch_matches() (arm64<->aarch64, amd64<->x86_64);
  ArchResource; PlatformResource gains archs/sha256_by_arch/arch_alias/is_res.
- xpkg-loader.cppm: parse the three new shapes; also fix a latent leak where
  the platform-level 'exports' table was parsed as a bogus version entry.
- tests: 6 new cases (per-arch map, template, res, legacy-unchanged, arch norm).

17/17 loader+arch tests pass.
@Sunrisepeak Sunrisepeak merged commit 9e934be into main Jun 26, 2026
1 check 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