Skip to content

A rule program is synthesised for a package with no device sources, contrary to the condition its comment states #715

Description

@speak-agent

Observed

run_build_program synthesises a build program for every package that has no build.mcpp and whose dependencies declare a rule_module (src/build/build_program.cppm, synthesised_rule_program). The comment at the synthesis site states the intended condition: "when a dependency's rules claimed device sources in this package". The code does not check that condition; it tests only env.ruleModules.empty().

A package that enables a rule feature only to import its module therefore runs the rule with its defaults. Such a package has no .ui, .qrc or .ts of its own; GalTranslPP's gpp.build is an example. Before mcpp-plugins 0.15.2, rules-qt then reported "no Qt SDK" once per consuming build. That was 5 warnings in one emit and 2 to 3 per member build, and each run costs a build-program compile.

[build-dependencies]
mcpp.plugins = { path = "…", features = ["rules-qt"], host-module = true }   # no build.mcpp, no device sources
       Rules mcpp.rules.qt (mcpp:plugins)
  build.mcpp compiling
  build.mcpp running
warning: helper: mcpp.rules.qt: no Qt SDK. …

mcpp-plugins 0.15.2 makes rules-qt silent in this case. The program is still compiled and run.

Request

Synthesise the program only when this package has device sources that a dependency's rule claims, as the comment says.

Activity

  1. added a commit that references this issue on Sep 27, 2026
  2. speak-agent commented on Sep 27, 2026

    @speak-agent
    MemberAuthor

    Fixed in mcpp 2026.9.27.1 (#719, merged as b439fd9), released on GitHub and mirrored to GitCode (xlings-res/mcpp), and published in the xim index (openxlings/xim-pkgindex#894).

    Verified after the release with the published binary inside an xlings subos sandbox (xlings subos use eco-0927 --sandbox --cmd ...), mcpp configured for the CN mirror in a fresh MCPP_HOME:

    • e2e 798_a_rule_applies_through_a_source_it_claims: a rule reaches a package's synthesised program only through a device source it claims. PASS.
    • mcpp:plugins 0.16.0 removes its 0.15.2 workaround; its qt-import-only fixture asserts that no build program runs for a package enabling rules-qt without Qt sources.
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