Skip to content

fix: preserve default index repo when custom index_repos configured#216

Merged
Sunrisepeak merged 1 commit intomainfrom
fix/build-index-missing-version-ref
Mar 21, 2026
Merged

fix: preserve default index repo when custom index_repos configured#216
Sunrisepeak merged 1 commit intomainfrom
fix/build-index-missing-version-ref

Conversation

@Sunrisepeak
Copy link
Member

Summary

  • When users add custom index_repos in .xlings.json (e.g. adding a ros2 repo), load_index_repos_from_json_() clears and replaces globalIndexRepos_ entirely, dropping the default xim index repo
  • This causes all packages in the primary index (like python, gcc, cmake, etc.) to become unfindable via xlings search or xlings install
  • After loading user-defined repos, the fix checks whether the default repo is present and prepends it if missing

Reproduction

# .xlings.json has: "index_repos": [{"name": "ros2", "url": "..."}]
xlings search python    # → "no packages found"
xlings install python   # → "package not found"

Test plan

  • XLINGS_HOME=/home/speak/.xlings ./build/.../xlings search python → finds xim:python
  • XLINGS_HOME=/home/speak/.xlings ./build/.../xlings search ros → finds both xim:* and ros2:* packages
  • Clean environment (no custom index_repos) still works as before

🤖 Generated with Claude Code

…re configured

When users add custom index_repos (e.g. "ros2") in .xlings.json,
load_index_repos_from_json_() replaces globalIndexRepos_ entirely,
dropping the default "xim" repo. This makes packages like "python"
from the primary index unfindable.

After loading user-defined repos, check whether the default repo
is present and prepend it if missing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Sunrisepeak Sunrisepeak merged commit ea7d891 into main Mar 21, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the fix/build-index-missing-version-ref branch March 21, 2026 18:22
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