Skip to content

feat(xim): persist declared xpkg exports to .xpkg-exports.json#351

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/persist-xpkg-exports
Jul 7, 2026
Merged

feat(xim): persist declared xpkg exports to .xpkg-exports.json#351
Sunrisepeak merged 1 commit into
mainfrom
feat/persist-xpkg-exports

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Companion to the hermetic toolchain link model work (mcpp-community/mcpp#196, mcpp issue #195).

glibc.lua declares exports.runtime.loader precisely so consumers don't hardcode the loader path — but the declaration never reached disk, so consumers re-derived it by convention. This persists the declared exports (relative form) to <install_dir>/.xpkg-exports.json at install time. mcpp's loader resolver already treats this file as its highest-priority source and falls back to a triple map + glob without it, so this PR is non-blocking for the mcpp release train.

Note: local build verification wasn't possible on this machine (pre-existing local toolchain-header issue affects clean main identically); relying on CI for the compile check.

…ts.json

Packages can declare runtime metadata (xpm.<platform>.exports.runtime:
loader / abi / libdirs — e.g. glibc declares its dynamic linker precisely
so consumers don't hardcode 'lib64/ld-linux-x86-64.so.2'), and xlings
already parses and uses it for elfpatch predicates. But the declaration
was invisible ON DISK, so downstream consumers (mcpp's toolchain link
model) had to re-derive the loader by convention (triple maps + globs).

Persist it at install time in the declared RELATIVE form; consumers join
against the payload root, so the file stays valid across copies and
symlink inheritance. Idempotent, also written for already-installed
payloads on their next resolve.
@Sunrisepeak Sunrisepeak merged commit c10dde7 into main Jul 7, 2026
7 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/persist-xpkg-exports branch July 7, 2026 12:10
Sunrisepeak added a commit that referenced this pull request Jul 7, 2026
…kg-exports.json (#351)" (#352)

The persisted file's only consumer was mcpp's toolchain link model, and the
entire mcpp 0.0.83 verification matrix (PR CI, hermetic container, fresh
installs across 3 platforms + 6 distro containers) ran green on xlings
0.4.62 — which never had this file — with mcpp's built-in fallback (per-arch
triple map + glob) covering every real-world case. A general-purpose package
manager should not carry a mechanism whose sole reader is one downstream
tool: reverted per layering review. The declared exports in package lua
(exports.runtime) are untouched — xlings' own elfpatch predicate still
consumes those. If an installed-state metadata DB is ever needed, it should
be designed with xlings itself as its first consumer.
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