Skip to content

Evaluate build files to accurately determine sources #62

@Tatskaari

Description

@Tatskaari

Right now, puku grungily handles a couple of expressions for srcs, specifically, it will evaluate globs, and resolve srcs that are other build targets. This has a couple shortcomings:

  1. We don't follow require/provide for sources
  2. We don't handle other expression types such as variables, or list concatenations.

We should be able to evaluate build files to determine the sources passed to each rule. This evaluation mode is different to how Please evaluates a file. When we encounter a build rule we care about, we want to preserve the args passed to it for later.

  1. Begin evaluation by walking the AST, interpreting the top level statements
  2. When we encounter a function call at the top level that matches one of our configured kinds, register the rule with the package. We should store the AST for the Call expression, as well as the evaluated arguments.
  3. Evaluate the build function to resolve the build definition to its build_rule()s

We will then have far more information about the build targets we're updating, including the resolved arguments passed to the build definition, and require/provide information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions