Repository navigation
Adapt to mcpp 2026.10.11.1: build.mcpp, its libraries and the engine interface in the build database #51
Description
Summary
From mcpp 2026.10.11.1 (mcpp-community/mcpp#797, PRs mcpp-community/mcpp#798 and mcpp-community/mcpp#800; released 2026-10-11), build.mcpp and the libraries it imports are compiled by an ordinary plan, the build programs' graph. mcpp emit build-database describes that graph in the S1 document (SPEC-005 v1.8, R3.13). mcppls can now give build.mcpp, the libraries in [build-dependencies] and the engine interface (import mcpp; / import mcpp.core;) the same navigation, completion and diagnostics as target code. This issue states what the document contains and what mcppls needs to change.
compile_commands.json and --spec compile-commands do not contain these units. This is deliberate: build.mcpp and the engine interface are an mcpp-ecosystem convention.
What the document contains (mcpp ≥ 2026.10.11.1)
Example output: mcpp emit build-database --format json on a project with [build-dependencies] lib = { path = "../lib" } and a build.mcpp that does import mcpp; import lib;.
set name |
family-name |
ide.configuration |
ide.kind |
units |
|---|---|---|---|---|
app |
app |
dev (the profile) |
executable |
the target, unchanged |
app:build |
app |
build-program |
executable |
build.mcpp (or a synthesised rule program) |
<pkg>:host (e.g. mcpplibs.lib:host) |
<pkg> |
build-program |
library |
the build-program instance of a library |
mcpp:core |
mcpp.core |
build-program |
library |
mcpp.cppm (provides mcpp), mcpp_core.cppm (provides mcpp.core) |
mcpp:std:host |
— | build-program |
— | the std module of the build-program configuration |
argumentsare the exact compile of the build programs' graph..mcppunits carry an explicit language (-x c++for GCC/Clang,/TPfor MSVC). Thework-directoryis under the planning directory, as for every set of a planning pass.visible-setsof a build-program set lists only sets of the same graph. Target sets never see build-program sets, and the reverse holds too.- One file in two sets. A package in both
[dependencies]and[build-dependencies]has a target set (<pkg>) and a:hostset. Their arguments may differ: features are per instance, and the build program has its own toolchain, standard and flags. - The engine interface's sources live in
engineModules(mcpp self env --format json→data.engineModules, e.g.~/.mcpp/engine/2026.10.11.1/modules). They are written once per mcpp version and never edited, so treat them as read-only. - When every build program is current, the command still plans the graph to describe it, without compiling.
What mcppls needs
- Language association. Treat
build.mcpp(any*.mcppfile) as C++ in the server and in the editor packages (VS Codecontributes.languages, the other editor configs undereditors/). - Set selection by configuration. A document under
build.mcppbelongs to<pkg>:build. A library file present in two sets resolves its imports in the set matching the importing context. For a file opened directly, prefer the target set; offer the:hostview only when the file is reached frombuild.mcpp. - Module resolution inside
build-programsets.import mcpp;/import mcpp.core;resolves to themcpp:coreunits, andimport std;tomcpp:std:host. The BMIs of these sets are built with their own arguments, never with a target set's. - Read-only engine sources. Go-to-definition into
mcpp:coreopens files underengineModules. Mark them read-only, and do not offer edits or code actions there. - Diagnostics for
build.mcppcome from theapp:buildarguments. A plugin unit (one that importsmcpp.core) reached from a target set is refused by mcpp (SPEC-007 P1). mcppls may show this as mcpp's diagnostic rather than an unresolved import. - Mock and conformance.
src/bin/mockmcpp.cppand the conformance fixtures need a document with these sets so the tests cover them. mcpp's e2etests/e2e/913_the_build_database_describes_the_build_programs.shis a reference fixture. - Version gate. These sets exist only from mcpp 2026.10.11.1. With an older mcpp the document has none of them, so keep the current behaviour.
References
- mcpp SPEC-005 R3.13 (
docs/specs/build-database.md), SPEC-004 §12 (docs/specs/manifest-semantics.md), SPEC-007 §10 (build plugins). - mcpp docs 30 — Libraries of a build program (
docs/30-build-mcpp.md). - Design:
.agents/docs/2026-10-11-build-dependencies-one-pipeline-design.md§7 in mcpp.
Activity
feat: build.mcpp, its libraries and mcpp's engine interface have the …
mcpp-language-server 0.0.12: the maintained mcppls-clangd engine, hea…
Sunrisepeak commentedon Oct 11, 2026
Done in 6a57181, released in v0.0.12:
.mcppis C++ in the server and in every editor integration.<pkg>:buildfor build programs with a toolchain of their own.engineModulesis read-only.build.mcppis diagnosed with its set's arguments.mcpp-build-programsfixture runs against a real mcpp 2026.10.11.1 on Linux, macOS and Windows..mcppfile says which mcpp describes it.Two follow-ups from field use are in #52: a half-typed
build.mcppdrops the targets' flags (2), and the mcpp version is lost, so a too-old mcpp is not named (4).