Description
Gazelle detected the duplicate names in the old file while merging rules, but the error was ignored. The new version of the rule is subsequently thrown away. Gazelle still finishes successfully. This is undesirable behavior because no two rules in the same file should have the same name. For regular build rules, Bazel doesn't not allow that. Although Bazel allows repository rules with the same name, Gazelle should not allow it for files/macros its updating.
If it's too chatty to report all merge errors, as the comment suggested, we can create a special error type for duplicate name, of which we are more certain about the validity, and properly handle this error type.
What version of gazelle are you using?
What version of rules_go are you using?
v0.23.3
What version of Bazel are you using?
3.3.1
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
Darwin amd64
What did you do?
- Create a copy of a
go_repository
rule and put it in the same file as the original rule - Update the version of that Go repository in
go.mod
and rungazelle update-repos
What did you expect to see?
At least one of the go_repository
rule is updated
What did you see instead?
Nothing updated