Commit 9335ec8
committed
Improve consistency by prefering bazel_dep over Go
Letting the bazel_dep and Go dependency participate equally in the
version resolution is creating various inconsistencies. This can lead to
to a root module having to either use `inject_repo` or `use_repo` and
`override_repo`.
Resolve this by consistently preferring the `bazel_dep` over the Go
dependency. Keep the existing code that warns (or can fail) if the
dependencies are at different versions.
Example MODULE.bazel:
```
module(
name = "bazel_dep_should_win",
)
bazel_dep(name = "rules_go", version = "0.53.0")
bazel_dep(name = "gazelle", version = "0.42.0")
bazel_dep(name = "circl", version = "1.3.8")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
```
And the go.mod referring to a newer version.
Fixes #20601 parent da58629 commit 9335ec8
1 file changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
570 | | - | |
571 | | - | |
| 569 | + | |
| 570 | + | |
572 | 571 | | |
573 | 572 | | |
574 | 573 | | |
| |||
620 | 619 | | |
621 | 620 | | |
622 | 621 | | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | 622 | | |
628 | 623 | | |
629 | 624 | | |
| |||
0 commit comments