Skip to content

Commit 33a2ae6

Browse files
committed
fix(build): quiet custom index bootstrap
1 parent 65af80c commit 33a2ae6

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

.agents/docs/2026-05-30-bmi-cache-custom-index-fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@ There is also a cache-key correctness gap: all dependency cache entries currentl
8080
- Implemented regression as `tests/e2e/49_bmi_cache_nested_custom_index.sh` because the defect is in CLI dependency resolution plus build-plan artifact collection, not only the lower-level cache copy functions.
8181
- Local verification: `mcpp build` succeeded, then `MCPP=target/x86_64-linux-gnu/4d24c8b57fdbbbb4/bin/mcpp bash tests/e2e/49_bmi_cache_nested_custom_index.sh` returned `OK`.
8282
- `mcpp test -- --gtest_filter=BmiCache.*` initially exposed an unrelated local environment issue: `~/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42` only had `.xpkg.lua` and no `bin/as`. Re-running with a temporary `MCPP_HOME` pointed at the complete installed mcpp registry passed: 15 test binaries ok, 0 failed.
83+
- Remote custom-index first-use sync now calls `update_index(..., quiet=true)` so `mcpp build` does not expose xlings update output. A non-zero update exits with a concise mcpp-level error.

src/cli.cppm

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,11 +1375,10 @@ prepare_build(bool print_fingerprint,
13751375
if (cfg2) {
13761376
mcpp::config::ensure_project_index_dir(**cfg2, *root, m->indices);
13771377

1378-
// On first build, the project xlings data root may be empty because
1379-
// ensure_project_index_dir only writes .xlings.json but doesn't
1380-
// trigger clone/link creation. Check whether there are any custom
1381-
// non-builtin indices and whether the project data roots have index content.
1382-
// If not, run xlings update before dependency resolution.
1378+
// On first build, the project index data root may be empty because
1379+
// ensure_project_index_dir only writes .xlings.json but does not
1380+
// trigger clone/link creation. Local path indices are read directly;
1381+
// remote custom indices are synced quietly before dependency resolution.
13831382
bool hasCustomIndices = false;
13841383
for (auto& [idxName, spec] : m->indices) {
13851384
if (!spec.is_builtin()) {
@@ -1397,9 +1396,12 @@ prepare_build(bool print_fingerprint,
13971396
break;
13981397
}
13991398
if (needsRemoteUpdate) {
1400-
mcpp::ui::status("Fetching", "custom index repos (first use)");
14011399
auto projEnv = mcpp::config::make_project_xlings_env(**cfg2, *root);
1402-
mcpp::xlings::update_index(projEnv);
1400+
int rc = mcpp::xlings::update_index(projEnv, /*quiet=*/true);
1401+
if (rc != 0) {
1402+
return std::unexpected(
1403+
"project custom index update failed; run `mcpp index update` for details");
1404+
}
14031405
}
14041406
}
14051407
}

0 commit comments

Comments
 (0)