From 685dc3e0f55121724de78468d95f77e4f0c274f4 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Wed, 8 Jul 2026 00:20:11 +0800 Subject: [PATCH] Revert "feat(xim): persist declared xpkg exports to /.xpkg-exports.json (#351)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/core/xim/installer.cppm | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/core/xim/installer.cppm b/src/core/xim/installer.cppm index 93d9472f..0c0a3b60 100644 --- a/src/core/xim/installer.cppm +++ b/src/core/xim/installer.cppm @@ -1600,28 +1600,6 @@ public: executor.apply_install_stamp_if_empty(ctx); } - // Persist declared exports next to the payload - // (/.xpkg-exports.json) so downstream consumers - // (e.g. mcpp's toolchain link model) read the DECLARED runtime - // metadata (loader/abi/libdirs) instead of re-deriving it by - // convention. Paths are written in their 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 so existing installs - // gain the file on their next resolve. - if (!node.exports.loader.empty() || !node.exports.abi.empty() - || !node.exports.libdirs.empty()) { - nlohmann::json rt; - if (!node.exports.loader.empty()) rt["loader"] = node.exports.loader; - if (!node.exports.abi.empty()) rt["abi"] = node.exports.abi; - if (!node.exports.libdirs.empty()) rt["libdirs"] = node.exports.libdirs; - nlohmann::json j; - j["runtime"] = std::move(rt); - std::ofstream exportsOs(ctx.install_dir / ".xpkg-exports.json"); - if (exportsOs) exportsOs << j.dump(2) << "\n"; - else log::debug("{}: could not write .xpkg-exports.json", node.name); - } - // Apply elfpatch auto-patching if the install hook enabled it if (!payloadInstalled) { // Ensure binDir is in PATH so elfpatch can find patchelf