fix(xim): elfpatch loader-provider resolution follows additive materialization#354
fix(xim): elfpatch loader-provider resolution follows additive materialization#354Sunrisepeak wants to merge 2 commits into
Conversation
…kg-exports.json (#351)" 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.
…y materialized (additive) Under xlings' additive (project-over-global) model, elfpatch resolved a runtime dep's provider install_dir from the plan node's NOMINAL storeRoot (or the pkginfo.dep_install_dir scan). When a project-scoped consumer reuses a loader-provider (e.g. xim:glibc) that is materialized only in the GLOBAL store, that pointed the consumer's PT_INTERP at a project store where the provider was never laid down → dangling interpreter → consumer can't exec. D1 (root-cause): add effective_install_dir_(node) — the store where a node's payload is ACTUALLY materialized, checked via the scoped version DBs in additive order (project_versions then global_versions), judged by the version-DB record (not "directory non-empty", which the .xpkg.lua fools). deps_exports and locate_dep_install_dir_ now use it, unifying build-dep PATH and elfpatch onto one resolution. In-memory only — does NOT reintroduce the reverted #351 persisted file. Independent of the mcpp xim-scoping fix; the OpenCV/cmake failure is fixed in mcpp. Design: .agents/docs/2026-07-09-scope-consistency-installed-check-and-loader-resolution.md Claude-Session: https://claude.ai/code/session_01Y3KE7MAE8yV7BG35eXy7FV
|
Dependency chain to land this:
The libxpkg fix branch currently sits atop the unmerged |
|
Closing per reassessment: this elfpatch additive-materialization fix (D1) is an INDEPENDENT robustness gap, NOT triggered by the opencv/cmake failure (whose only needed fix is mcpp 0.0.87, already shipped). No current package exercises its scenario (project-scoped dynamic executable runtime-depending on a global-only loader-provider); opencv CI already gets past the loader stage on plain 0.0.87. Reopen when a real use case appears. Detailed reassessment: mcpp-index .agents/docs/2026-07-09-install-hook-toolchain-build-env-gap.md + the D1 design doc. |
Problem (independent of the mcpp OpenCV fix)
Under xlings' additive (project-over-global) model, elfpatch resolved a runtime dep's provider
install_dirfrom the plan node's nominalstoreRoot(or thepkginfo.dep_install_dirscan). When a project-scoped consumer reuses a loader-provider (e.g.xim:glibc) materialized only in the global store, the consumer's PT_INTERP got pointed at a project store where the provider was never laid down → dangling interpreter.Fix (D1, root-cause)
effective_install_dir_(node)— the store where a node's payload is actually materialized, checked via the scoped version DBs in additive order (project_versions→global_versions), judged by the version-DB record (not "dir non-empty", which.xpkg.luafools).deps_exportsbuild +locate_dep_install_dir_now use it, unifying build-dep PATH and elfpatch onto one resolution..xpkg-exports.json.Pairing / sequencing (maintainer input needed)
This pairs with a libxpkg change (branch
fix/elfpatch-effective-install-diron openxlings/libxpkg):DepExport.install_dir+ push into in-memory_RUNTIME.deps_exports, andelfpatch.lua closure_lib_pathspreferring the injected effective dir. That libxpkg branch currently sits atop the in-flightfeat/xpm-v2-multiarch-mainwork, so base-branch sequencing (V2 first?) is a maintainer call — I did not auto-merge.Verification
Builds (
xlings 0.4.62); deterministic Lua harness proves the mechanism (effective global store resolves to the materialized loader; old nominal-scope path resolved to the empty project store); e2e regressionsproject_global_fallback_test.sh,project_local_repo_test.sh,pkginfo_install_dir_test.shpass.Design:
.agents/docs/2026-07-09-scope-consistency-installed-check-and-loader-resolution.mdIndependent of the OpenCV/cmake failure (fixed in mcpp-community/mcpp#205).
https://claude.ai/code/session_01Y3KE7MAE8yV7BG35eXy7FV