Skip to content

Emit warning when Dependencies has zero files and aggregating = false #3100

Description

@jaschdoc

Ok^^, well i don't want to speculate too much about hypothetical use-cases. We do use signatures that are input for the generator, so in our case we should specify those classes as dependencies.

If empty dependencies with aggregate=false is not a valid KSP configuration, getting a warning would be good i guess, maybe even a hard error in future releases.

Originally posted by @Jan-Thes in #2854

It's a helpful to emit a warning when Dependencies contains zero files and has aggregating = false. This means that the generated file depends only on the empty set of output files. However, if that is really the case, then it might as well just be a source file in project instead of being generated. The reasoning in terms of incremental compilation is as follows:

  • Either the generated output file should be regenerated when any file changes, in which case it should be configured with aggregating = true.
  • Or it should only be generated once and included in all builds.
    • Assume that the file really does not depend on the codebase. In this case, generating it is a one-time procedure and it can be included in the project as is.
    • Assume that the generated output file does in fact depend on at least one source file in the project. In this case, it should reference that same source file in the Dependencies object. However, that contradicts that it has no dependencies, i.e., that the list is of length zero (it is strictly greater).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4lower priority; no milestone yetenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions