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

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