@@ -170,6 +170,36 @@ package's index file, not just the official index directory. If the package
170170file is absent, mcpp should silently run ` xlings update ` before calling either
171171the NDJSON interface install path or the direct CLI fallback.
172172
173+ ### 8. xlings index cache can be poisoned by temp-home symlinked indexes
174+
175+ The fourth PR checkpoint still failed in the same Linux musl step. Local
176+ inspection revealed an additional xlings cache layer:
177+
178+ ``` text
179+ xim-pkgindex/.xlings-index-cache.json
180+ ```
181+
182+ That cache stores absolute ` path ` values for each xpkg file. mcpp e2e tests
183+ inherit the global ` xim-pkgindex ` into temp ` MCPP_HOME ` directories, often via
184+ symlink. When xlings rebuilds the cache from that temp home, it can write paths
185+ like:
186+
187+ ``` text
188+ /tmp/tmp.X.../mcpp-home/registry/data/xim-pkgindex/pkgs/m/musl-gcc.lua
189+ ```
190+
191+ into the shared global index directory. Later, the main sandbox loads that
192+ cache and ` PackageCatalog::build_match_() ` calls ` load_package() ` on the stale
193+ temp path. The load fails, the match is discarded, and the user-facing error is
194+ still:
195+
196+ ``` text
197+ package 'xim:musl-gcc@15.1.0' not found
198+ ```
199+
200+ So the mcpp guard must also reject a package cache whose target package entry
201+ does not point at the current sandbox's package file.
202+
173203## Implementation Plan
174204
175205- [x] Add focused regression coverage for default-index refresh quietness.
@@ -187,6 +217,8 @@ the NDJSON interface install path or the direct CLI fallback.
187217 before auto-installing ` xim: ` toolchain packages.
188218- [x] Require the target package file to exist before treating an official
189219 ` xim: ` index as fresh.
220+ - [x] Reject xlings index caches whose target package path points at a foreign
221+ temp/home directory.
190222- [x] Validate with the local xlings checkout using the new mcpp binary.
191223- [x] Push a draft PR and use it as the multi-commit checkpoint.
192224
@@ -273,3 +305,19 @@ the NDJSON interface install path or the direct CLI fallback.
273305 passed.
274306 - `/tmp/mcpp-fresh-codex clean && /tmp/mcpp-fresh-codex build --target
275307 x86_64-linux-musl` passed and resolved ` gcc@15.1.0-musl`.
308+ - The next CI run still failed at the same musl step. The remaining issue is
309+ xlings' ` .xlings-index-cache.json ` using absolute package-file paths that
310+ can be written from e2e temp homes into the shared index directory.
311+ - Added cache-path validation for the target package file in
312+ ` is_official_package_index_fresh() ` .
313+ - Added two unit tests for foreign/current package paths inside
314+ ` .xlings-index-cache.json ` .
315+ - Local verification after this cache-path fix:
316+ - ` mcpp test -- --gtest_filter=XlingsIndexFreshness.* ` passed with 10
317+ matching ` test_xlings ` cases.
318+ - ` mcpp build --no-cache ` passed.
319+ - e2e ` 49_bmi_cache_nested_custom_index.sh ` ,
320+ ` 52_local_path_namespaced_index.sh ` , and ` 53_namespaced_cache_label.sh `
321+ passed.
322+ - `/tmp/mcpp-fresh-codex clean && /tmp/mcpp-fresh-codex build --target
323+ x86_64-linux-musl` passed and resolved ` gcc@15.1.0-musl`.
0 commit comments