Skip to content

Not all attributes are present in module tags with sensible default values #14528

@shs96c

Description

@shs96c

Description of the problem / feature request:

When using bazel 5.0.0rc3, declare a module tag similar to:

mytag = tag_class(
    attrs = {
        "target": attr.label(),
    },
)

If the tag is used in MODULE.bazel file without a value (eg. mytag()), then in the module's implementation function calls to mytag.target will fail, whereas it's expected they return None, as happens with empty attributes on repository and regular rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)area-BzlmodBzlmod-specific PRs, issues, and feature requeststeam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions