Skip to content

emit build-database for IDEs: one failing member loses the whole database, and build programs cannot tell a plan pass #699

Description

@Sunrisepeak

mcpp-language-server gets a project's model from mcpp emit build-database --format json. Reproducing Sunrisepeak/mcpp-language-server#23 on a real 5-member Windows workspace (GalTranslPP: vcpkg + Qt 6, mcpp 2026.9.25.1, windows-2025) showed two properties of emit that cost the editor its model. Both are behaviour the spec states today, so this is a request, not a bug report. Tracked on our side as UP-M2 / UP-M3 in Sunrisepeak/mcpp-language-server#24.

1. One member's failure loses every set (SPEC-005 R5.2)

  • GPPGUI's build program calls mcpp::dep_bin("gpp.updater", "Updater"). Building that host tool ran its own lupdate check action, which failed on that machine (lupdate.exe could not load Qt6Qml.dll).
  • Result: MCPP_BUILD_DATABASE_PLAN_FAILED: GPPGUI: building host tool 'updater:Updater' failed, and no data — the four members that planned fine got no database either.
  • Effect: the language server falls back to a guessed model for the whole workspace (a toolchain it found, no include directories); clangd then crashed repeatedly on it.

Ask: when some members plan and others fail, return data with the sets that planned, plus an error diagnostic per failed member, under a code a consumer can tell apart from a total failure (e.g. MCPP_BUILD_DATABASE_PARTIAL).

2. A build program cannot tell it is running for a plan (SPEC-005 R2.5)

  • emit runs build.mcpp exactly as build does and builds dependencies' host tools, with no signal in the MCPP_* contract.
  • A build program that checks the full environment (a Qt root, a vcpkg .lib per library) — or a host tool whose build runs project checks, as above — fails emit on every machine that cannot build yet. That is exactly when an editor most needs the model.
  • mcpp::action edges already do not run under emit (R2.2); the problem is work done in the program itself and in host-tool builds.

Ask (any of):

  • a documented signal, e.g. MCPP_PLAN_ONLY=1 / mcpp::plan_only(), so a program can skip checks and heavy work while planning;
  • under emit, a build-program failure becomes a diagnostic for that member instead of failing the command (pairs with 1);
  • under emit, do not run the check actions a host-tool build declares.

Evidence

Activity

  1. speak-agent commented on Sep 26, 2026

    @speak-agent
    Member

    Released in mcpp 2026.9.26.2 (#702, squash c109fdd6).

    mcpp emit build-database now plans every selected member on its own:

    • A member whose planning fails contributes no sets and one error diagnostic whose path names its mcpp.toml. data is present when any member planned, and its watch also lists each failed member's mcpp.toml and build.mcpp. The exit status is 1 whenever an error is present.
    • Under emit, a host tool that does not build is the warning MCPP_BUILD_DATABASE_HOST_TOOL_UNBUILT. Planning continues, and the requesting build program receives the path the tool would be published at. mcpp build still fails as before.
    • A package whose build program fails is described without that program's directives, with the error MCPP_BUILD_DATABASE_PROGRAM_FAILED whose path names its build.mcpp.
    • The plan-only signal is not added: verification belongs in check actions, which emit does not run (design record §4.7, SPEC-007 R1.2, R1.4).

    S2 0.3.0 states the partial answer (S2-3.4-12, S2-3.4-13). It landed in Sunrisepeak/mcpp-language-server#26 together with the consumer side, and mcppls 0.0.5 reports each part the producer could not describe as producer-partial.

    The same release also changes the compile database, based on the report that accompanied this issue:

    • one database per configuration;
    • directory is the output directory;
    • a module interface's entry carries its language flag;
    • the standard-library units are listed.

    Readings:

  2. added a commit that references this issue on Sep 26, 2026
  3. added a commit that references this issue on Oct 3, 2026
    c109fdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions