xlings now builds through mcpp and uses a local project index:
[indices]
xlings = { path = "mcpp" }During a first build, mcpp build currently prints Fetching custom index repos (first use) followed by xlings update output, then emits warnings such as:
warning: bmi cache populate failed for tinyhttps@0.2.3: expected build output missing: .../obj/tinyhttps.m.o
warning: bmi cache populate failed for xlings.libarchive@3.8.7: expected build output missing: .../obj/xxhash.o
The build itself can still succeed, but the dependency BMI cache is not populated for affected packages.
There are two related build-tool issues.
-
Project custom-index bootstrap is too broad.
mcppseeds.mcpp/.xlings.jsonfor non-builtin[indices]and treats the project index data as uninitialized when noxim-indexrepos.jsonor clonedpkgs/directory exists. It then runsxlings update, which prints all configured xlings index update output. For a local path index, the localpkgs/tree already exists and can be read directly, so the update path is mostly noise and can create extra first-build work. -
BMI cache records object basenames instead of object paths relative to
obj/.The build plan correctly writes objects under collision-avoiding subdirectories, for example:
obj/mcpplibs_tinyhttps_src/tinyhttps.m.o obj/xlings_libarchive_libarchive/xxhash.o obj/xlings_zlib_zlib-1.3.2/compress.oThe cache populate list currently stores only
cu.object.filename(), so it later searches for:obj/tinyhttps.m.o obj/xxhash.o obj/compress.oThose files do not exist, so
populate_from()returnsexpected build output missing.
There is also a cache-key correctness gap: all dependency cache entries currently use the default index name. Custom-index dependencies should carry their real namespace/index identity so cache entries from different indices do not collide.
-
Add regression coverage first.
- Add an e2e regression that builds a local-path custom-index dependency with duplicate object basenames.
- Assert that local-path indices do not trigger first-use
xlings updatenoise. - Assert that the cache manifest is written under the custom index name and preserves nested object paths.
- Assert that a second cold build reuses the dependency BMI cache.
-
Fix artifact path recording.
- When collecting dependency artifacts in
src/cli.cppm, store object paths relative toctx.outputDir / "obj"instead of only the object filename. - Keep BMI filenames as basenames because compiler BMI output is intentionally flat in the active BMI directory.
- When collecting dependency artifacts in
-
Fix dependency cache identity.
- Use the dependency namespace or custom index name in
CacheKey::indexNameinstead of always using the global default index. - Preserve builtin/default behavior for existing
mcpplibspackages.
- Use the dependency namespace or custom index name in
-
Reduce local custom-index update noise.
- Treat local
{ path = ... }indices as initialized when the source path has apkgs/directory. - Keep remote custom indices on the existing project
xlings updatepath.
- Treat local
-
Verify.
- Run targeted BMI cache unit tests.
- Run the broader unit suite or project test command available in the repository.
- Run a local
mcpp buildscenario when feasible to ensure the original warning no longer appears.
- If tests reveal that
CacheKey::indexNameis used as a namespace rather than a repository identity, prefer the package namespace as the cache partition and document the remaining repository-revision hardening as follow-up. - If local path indices still need xlings project metadata for install operations, skip only the update call, not
.mcpp/.xlings.jsonseeding. - Implemented regression as
tests/e2e/49_bmi_cache_nested_custom_index.shbecause the defect is in CLI dependency resolution plus build-plan artifact collection, not only the lower-level cache copy functions. - Local verification:
mcpp buildsucceeded, thenMCPP=target/x86_64-linux-gnu/4d24c8b57fdbbbb4/bin/mcpp bash tests/e2e/49_bmi_cache_nested_custom_index.shreturnedOK. mcpp test -- --gtest_filter=BmiCache.*initially exposed an unrelated local environment issue:~/.mcpp/registry/data/xpkgs/xim-x-binutils/2.42only had.xpkg.luaand nobin/as. Re-running with a temporaryMCPP_HOMEpointed at the complete installed mcpp registry passed: 15 test binaries ok, 0 failed.- Remote custom-index first-use sync keeps the mcpp-level
Fetching custom index repos (first use)status, but callsupdate_index(..., quiet=true)somcpp builddoes not expose xlings update output. A non-zero update exits with a concise mcpp-level error.
- Landed with PR #88: #88
- Released in
mcpp 0.0.35: https://github.com/mcpp-community/mcpp/releases/tag/v0.0.35 - The mcpp status line remains visible, but internal
xlings updateoutput is quiet. - The xlings migration PR #314 completed without
warning: bmi cache populate failedin the LinuxE2E-00: mcpp builds xlings from sourcelog.
The final local xlings verification exposed a separate default-index freshness bug:
when ~/.mcpp/registry/data contained other xlings-managed index clones but no
mcpplibs clone, mcpp treated the registry as fresh and skipped the default
index update. mcpp build then failed before dependency resolution with:
error: dependency 'compat.libarchive': index entry not found in local clone
Fix for 0.0.36:
is_index_fresh()now requiresregistry/data/mcpplibs/pkgsspecifically.- Regression coverage verifies that an unrelated
xim-pkgindex/pkgstree no longer satisfies defaultmcpplibsfreshness. - A fresh/mixed user cache will trigger the normal default-index update path
before searching or building
compat.*dependencies.