feat: custom [indices] in mcpp.toml with project-level isolation#39
Merged
Conversation
…evel isolation Implement the first phase of custom package index support: - Fill in IndexSpec struct in src/pm/index_spec.cppm (name, url, rev, tag, branch, path) with is_local/is_pinned/is_builtin helpers - Parse [indices] section in mcpp.toml (short string form, inline table with url/rev/tag/branch/path, and local path form) - Parse [indices] section in config.toml (global config) - Add indices field to Manifest and GlobalConfig structs - Add projectDir field to xlings::Env; build_command_prefix conditionally sets XLINGS_PROJECT_DIR for project-level isolation - Add ensure_project_index_dir() to create .mcpp/.xlings.json with custom index entries when non-builtin indices are configured - Add Fetcher::read_xpkg_lua_from_path() for local path index support - Update cmd_index_list to display project-level indices from mcpp.toml - Update prepare_build to set up .mcpp/ directory for custom indices - Add E2E test (42_custom_local_index.sh) verifying parsing + display
This was referenced May 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[indices]section inmcpp.tomlandconfig.tomlfor configuring custom package index repositoriesacme = "git@...") , long form (acme = { url = "...", tag = "v2.0" }) , and local path (local = { path = "/..." })XLINGS_PROJECT_DIR: custom indices get their own.mcpp/directory, while built-in indices (mcpplibs) stay global.mcpp/.xlings.jsonChanges
src/pm/index_spec.cppmIndexSpecstruct (name, url, rev, tag, branch, path) withis_local(),is_pinned(),is_builtin()helperssrc/manifest.cppmManifest::indicesfield +[indices]TOML parsing (short/long/path forms)src/config.cppmGlobalConfig::indices+[indices]parsing in config.toml +ensure_project_index_dir()+make_project_xlings_env()src/xlings.cppmEnv::projectDirfield +build_command_prefix()dual mode (global vs project-level)src/pm/package_fetcher.cppmread_xpkg_lua_from_path()for local path index direct readingsrc/cli.cppmcmd_index_listshows project indices +prepare_buildcallsensure_project_index_dirtests/e2e/42_custom_local_index.shmcpp index listverificationDesign
[indices]key = index name (maps to xlings repo{name, url}), not namespacenamespacefield; falls back to index name if absent~/.mcpp/registry/), custom indices use project-level.mcpp/viaXLINGS_PROJECT_DIR(verified: additive mode, global repos remain visible).agents/docs/2026-05-16-indices-enhancement-design.mdfor full designTest plan
mcpp buildcompiles successfully with all changes42_custom_local_index.shpasses (local path index parsing + index list)01_help_and_version.sh,11_index_list.shpass (no regression)mcpp index listshows project indices when[indices]is configured