feat(xpkg): V2 multi-arch xpm schema + arch normalization (0.0.42)#25
Merged
Conversation
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.
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
Make CPU architecture a first-class, declarative dimension of the xpm schema (V2). A version-entry value may now be:
{ x86_64 = {url,sha256}, aarch64 = {...} }{ url="...${arch}...", sha256={...}, arch_alias={...} }res = true+ per-arch sha256 — XLINGS_RES auto-URL, now with checksumsAll 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;PlatformResourcegainsarchs/sha256_by_arch/arch_alias/is_res.xpkg-loader.cppm: parse the three new shapes; fix a latent leak where the platform-levelexportstable was parsed as a bogus version entry.Downstream
Consumed by openxlings/xlings (XPackage V2 install-time resolution). After merge: tag
v0.0.42, publish to mcpp-index, then bump xlings'mcpplibs.xpkgpin to 0.0.42.🤖 Generated with Claude Code