Skip to main content

Rule.attribute

Rule.attribute: list[attribute]
All of the attributes that describe the rule.

Rule.configured_rule_input

Rule.configured_rule_input: list[configured_rule_input]

Rule.default_setting

Rule.default_setting: list[str]
The set of all “features” inherited from the rule’s package declaration.

Rule.definition_stack

Rule.definition_stack: list[str]
The Starlark call stack for the definition of the rule class of this particular rule instance. If empty, either populating the field was not enabled on the command line with the —proto:definition_stack flag or the rule is a native one.

Rule.deprecated_is_skylark

Rule.deprecated_is_skylark: None | bool

Rule.deprecated_public_by_default

Rule.deprecated_public_by_default: None | bool
The rule’s class’s public by default value.

Rule.instantiation_stack

Rule.instantiation_stack: list[str]
The Starlark call stack at the moment the rule was instantiated. Each entry has the form “file:line:col: function”. The outermost stack frame (” <toplevel>”, the BUILD file) appears first; the frame for the rule function itself is omitted. The file name may be relative to package’s source root directory. Requires —proto:instantiation_stack=true.

Rule.location

Rule.location: None | str
The BUILD file and line number of the location (formatted as <absolute_path>:<line_number>:<column_number>) in the rule’s package’s BUILD file where the rule instance was instantiated. The line number will be that of a rule invocation or macro call (that in turn invoked a rule). See

Rule.name

Rule.name: str
The name of the rule (formatted as an absolute label, e.g. //foo/bar:baz).

Rule.rule_class

Rule.rule_class: str
The rule class name (e.g., java_library). Note that the rule class name may not uniquely identify a rule class, since two different .bzl files may define different rule classes with the same name. To uniquely identify the rule class, see rule_class_key field below.

Rule.rule_class_info

Rule.rule_class_info: None | rule_info
Stardoc-format rule class API definition for this rule. Includes both Starlark-defined and native (including inherited) attributes; does not include hidden or explicitly undocumented attributes. Populated only for the first rule in the stream with a given rule_class_key. Requires —proto:rule_classes=true

Rule.rule_class_key

Rule.rule_class_key: None | str
A key uniquely identifying the rule’s rule class. Stable between repeated blaze query invocations (assuming that there are no changes to Starlark files and the same blaze binary is invoked with the same options). Requires —proto:rule_classes=true

Rule.rule_input

Rule.rule_input: list[str]
All of the inputs to the rule (formatted as absolute labels). These are predecessors in the dependency graph.

Rule.rule_output

Rule.rule_output: list[str]
All of the outputs of the rule (formatted as absolute labels). These are successors in the dependency graph.

Rule.skylark_environment_hash_code

Rule.skylark_environment_hash_code: None | str
Hash encapsulating the behavior of this Starlark rule. Any change to this rule’s definition that could change its behavior will be reflected here.