Skip to content

fix(config): don't inject official global xim index into project scope (0.0.87)#205

Merged
Sunrisepeak merged 2 commits into
mainfrom
fix/xim-project-scope-global-infra
Jul 9, 2026
Merged

fix(config): don't inject official global xim index into project scope (0.0.87)#205
Sunrisepeak merged 2 commits into
mainfrom
fix/xim-project-scope-global-infra

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Problem

Project-local mode (a project with a custom [indices], e.g. a local path index) force-added the official xim index into the project's .xlings.json index_repos (ensure_project_index_dir, config.cppm). But xlings scopes by which group a repo lands in — packages from project index_repos are PackageScope::Project. So every xim global tool (cmake/glibc/gcc/make/binutils) resolved project-scoped and installed into the project store instead of the shared registry.

That broke ELF loader resolution for build-dep tools: a build-dep xim:cmake's interpreter got patched to an unmaterialized project-store glibccannot execute: required file not found. Any compat package running a glibc-dynamic build-dep tool in install() (e.g. a source-built CMake OpenCV) failed under mcpp test, universally (fresh MCPP_HOME too — mcpp's toolchain bootstrap records glibc globally, which then shadowed the project store).

Fix

global IS the default. xim (and its dynamically-discovered sub-indexes) are xlings global-default indices; xim:* resolves at global scope via the global index_repos + the registry-local xim clone, and stays visible to the project via additive. Only user-declared local custom indices are project-scoped.

  • Remove the xim injection into the project customRepos.
  • Remove the project-data-dir xim copy/exposure (dead once xim isn't a project repo).
  • Not a hardcoded allowlist — the principle is simply "don't inject an index the user didn't declare"; this is naturally correct for xim's dynamic sub-indexes too.

Verification

  • opencv workspace member (source-built core+imgproc+imgcodecs via install() CMake) now closescmake installs to the global registry, project store holds only the local package; test result ok.
  • mcpp self-test: 30/30 (updated Config.ProjectIndexDirDoesNotInjectOfficialXimIndex to assert the correct behavior).
  • mcpp-index full workspace green (no regression for eigen/openblas/core/…).

Bumps 0.0.86 → 0.0.87.

Design + full root-cause analysis: .agents/docs/2026-07-09-project-index-scope-global-infra-fix.md

https://claude.ai/code/session_01Y3KE7MAE8yV7BG35eXy7FV

Project-local mode (a project with a custom `[indices]`, e.g. a local path
index) force-added the official `xim` index into the project's `.xlings.json`
`index_repos` (ensure_project_index_dir), intending to make `xim:*` deps
resolvable in project mode. But xlings scopes by which group a repo lands in:
packages from project `index_repos` are `PackageScope::Project`. So every `xim`
GLOBAL tool (cmake/glibc/gcc/make/binutils/…) resolved project-scoped and
installed into the project store instead of the shared registry. That broke ELF
loader resolution for build-dep tools — a build-dep `xim:cmake`'s interpreter was
patched to an unmaterialized project-store glibc → `cannot execute`. Any compat
package running a glibc-dynamic build-dep tool in install() (e.g. a source-built
CMake OpenCV) failed under `mcpp test`, universally (fresh MCPP_HOME too).

global IS the default: `xim` (and its dynamically-discovered sub-indexes) are
xlings global-default indices. `xim:*` resolves at global scope via the global
index_repos + the registry-local xim clone, and stays visible to the project via
additive. Only user-declared local custom indices are project-scoped. Remove the
xim injection and the project-data-dir xim exposure; not a hardcoded allowlist —
just don't inject an index the user didn't declare.

Verified: opencv workspace member closes (cmake now installs to the global
registry, project store holds only the local package); mcpp self-test 30/30;
mcpp-index full workspace green.

Design + analysis: .agents/docs/2026-07-09-project-index-scope-global-infra-fix.md
Bumps 0.0.86 → 0.0.87.

Claude-Session: https://claude.ai/code/session_01Y3KE7MAE8yV7BG35eXy7FV
…matches fix)

The fake-xlings in 52_local_path_namespaced_index.sh asserted the OLD behavior
(project .xlings.json must contain the official xim index). Flip it: xim is a
global-default index and must NOT be injected project-scoped. Verified: e2e 52 OK.

Claude-Session: https://claude.ai/code/session_01Y3KE7MAE8yV7BG35eXy7FV
@Sunrisepeak Sunrisepeak merged commit 558d286 into main Jul 9, 2026
6 checks passed
@Sunrisepeak Sunrisepeak deleted the fix/xim-project-scope-global-infra branch July 9, 2026 08:04
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