Aspect attr does not support default values for bool or int #22809
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-API
API for writing rules/aspects: providers, runfiles, actions, artifacts
type: bug
Description of the bug:
Given the following aspect:
Applied to the following rule:
When the
example_bool_attr
or theexample_int_attr
are uncommented the build fails with an error that reads like:This is unexpected because both of these attrs have default values, even more confusing is that the string attr with a default value works without requiring
example_rule
to have an attr of the nameexample_string_attr
.Am I missing something here and this behavior is expected or is this a bug?
Which category does this issue belong to?
Core, Documentation, Rules API
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Use the provided example rule and aspect to verify the failure.
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 7.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: