Revert "go_deps: allow local module replacements, with a flag (#2317)"#2321
Merged
Revert "go_deps: allow local module replacements, with a flag (#2317)"#2321
Conversation
This reverts commit 7c54844.
fmeum
approved these changes
Apr 1, 2026
jayconrod
added a commit
that referenced
this pull request
Apr 5, 2026
**What type of PR is this?** > Bug fix **What package or component does this PR mostly affect?** > all **What does this PR do? Why is it needed?** This lets us drop the `replace` from go.mod, which is blocking `go install` in #2319. And it more accurately represents how Gazelle is managing dependencies: we'll need to do this anyway if `v2/go.mod` requires something that `go.mod` does not. This requires a substantial change in `go_deps`. I've renamed the `bazel_deps` list to `bazel_go_modules` to reflect the fact that with `go.work`, Bazel modules and Go modules are not one-to-one: a Bazel module like `gazelle` may contain multiple Go modules. We should not generate `go_repository` definitions for these, nor should we warn about selected version differences. Unfortunately, we can't ignore `go.work` files outside the main module. Gazelle's `deps` labels refer to `//v2/...` packages within the same module; clients cannot have a different view of the module boundaries. This change means that we don't need `ignore_local_replaced_modules`, so reverting that in #2321 since it's not released yet. **Which issues(s) does this PR fix?** Fixes #2319 **Other notes for review**
wonderyl
pushed a commit
to wonderyl/bazel-gazelle
that referenced
this pull request
Apr 13, 2026
…-contrib#2320) **What type of PR is this?** > Bug fix **What package or component does this PR mostly affect?** > all **What does this PR do? Why is it needed?** This lets us drop the `replace` from go.mod, which is blocking `go install` in bazel-contrib#2319. And it more accurately represents how Gazelle is managing dependencies: we'll need to do this anyway if `v2/go.mod` requires something that `go.mod` does not. This requires a substantial change in `go_deps`. I've renamed the `bazel_deps` list to `bazel_go_modules` to reflect the fact that with `go.work`, Bazel modules and Go modules are not one-to-one: a Bazel module like `gazelle` may contain multiple Go modules. We should not generate `go_repository` definitions for these, nor should we warn about selected version differences. Unfortunately, we can't ignore `go.work` files outside the main module. Gazelle's `deps` labels refer to `//v2/...` packages within the same module; clients cannot have a different view of the module boundaries. This change means that we don't need `ignore_local_replaced_modules`, so reverting that in bazel-contrib#2321 since it's not released yet. **Which issues(s) does this PR fix?** Fixes bazel-contrib#2319 **Other notes for review**
wonderyl
pushed a commit
to wonderyl/bazel-gazelle
that referenced
this pull request
Apr 13, 2026
…contrib#2317)" (bazel-contrib#2321) This reverts commit 7c54844. **What type of PR is this?** > Other **What package or component does this PR mostly affect?** > go_deps **What does this PR do? Why is it needed?** Reverts bazel-contrib#2317. bazel-contrib#2320 seems like a better solution for the same problem. **Which issues(s) does this PR fix?** For bazel-contrib#2315 **Other notes for review** Merge after bazel-contrib#2320.
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 7c54844.
What type of PR is this?
What package or component does this PR mostly affect?
What does this PR do? Why is it needed?
Reverts #2317.
#2320 seems like a better solution for the same problem.
Which issues(s) does this PR fix?
For #2315
Other notes for review
Merge after #2320.