This flag disables the default parameter on attr.output and attr.output_list.
Flag: --incompatible_no_output_attr_default
Available since: 0.23 (February 2019 release)
Motivation
The previous default parameter of these attribute types was severely bug-prone, as two targets of the same rule would be unable to exist in the same package under default behavior. (Two targets both generating foo.txt in the same package would conflict.)
Additional details in #6241
Migration
Use Starlark macros to specify defaults for these attributes instead.
For example, replace:
my_rule = rule(
...
attrs = {"out" : attr.output(default = "foo.txt")}
...
with:
# myrule.bzl
my_rule = rule(
...
attrs = {"out" : attr.output()}
...
# mymacro.bzl
load(":myrule.bzl", _my_rule = "my_rule")
def my_rule(name):
_my_rule(
name = name,
output = "%s_out.txt" % name
)
This flag disables the default parameter on
attr.outputandattr.output_list.Flag: --incompatible_no_output_attr_default
Available since: 0.23 (February 2019 release)
Motivation
The previous default parameter of these attribute types was severely bug-prone, as two targets of the same rule would be unable to exist in the same package under default behavior. (Two targets both generating foo.txt in the same package would conflict.)
Additional details in #6241
Migration
Use Starlark macros to specify defaults for these attributes instead.
For example, replace:
with: