-
Notifications
You must be signed in to change notification settings - Fork 406
Open
Description
What version of gazelle are you using?
0.37.0
What version of rules_go are you using?
0.49.0
What version of Bazel are you using?
7.2.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOS 15.1 aarch64
What did you do?
I generated some empty rules to remove existing rules in BUILD files:
func cleanUndefinedRules(res *language.GenerateResult, f *rule.File) {
for _, fr := range f.Rules {
if ... {
continue
}
r := rule.NewRule(fr.Kind(), fr.Name())
res.Empty = append(res.Empty, r)
}
}
The kind definition has:
MergeableAttrs: map[string]bool{
"srcs": true,
}
and the current build file has:
some_rule(
name = "test",
srcs = glob([...]),
)
What did you expect to see?
the "test" target gets removed.
What did you see instead?
gazelle: BUILD.bazel:124.12-124.29: could not merge expression
and the target is untouched after the run.
This is because when merging the attrs, if the dst is not a scalar, it can't be removed.
Line 105 in 2898dda
if srcAttr == nil && (dst == nil || isScalar(dst)) { |
Metadata
Metadata
Assignees
Labels
No labels