bazel-gazelle
bazel-gazelle copied to clipboard
[Fixes #1736] disable proto generation for external go modules by default
[Fixes #1736] disable proto generation for external go modules by default
Note I am really not an expert in the proto / go world, so I could be misunderstanding some important details. I've attempted to do some research, but someone with more expertise here should likely sanity check this approach.
What type of PR is this?
Uncomment one line below and remove others.
Bug fix
Feature Documentation Other
What package or component does this PR mostly affect?
For example:
language/go cmd/gazelle
go_repository
all
What does this PR do? Why is it needed?
By convention go modules with proto files are to generate pb.go bindings at publish time, this PR ensures we don't regenerate those bindings for external dependencies, as doing so is quite wasteful as it introduces the full protoc toolchain which itself also needs to be built from scratch.
For folks that want the old behavior, they can add an override for the go mod in question by doing the following:
go_deps.gazelle_override(
directives = [ ],
path = "<go module id>",
)
Which issues(s) does this PR fix?
Fixes #1736
Other notes for review
Tasks
- [X] prototype
- [X] Ensure it doesn't break CI
- [x] test in real application
- [ ] sanity check approach with someone more familiar with this domain then myself
- [ ] discuss automated testing strategy for this PR with gazelle team
- [ ] doc updates?
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Any update?
ping @stefanpenner I think this work is very meaningful, and it would be great if it could be merged.
Looks Like im working on bazel stuff again, so I will try to carve out some time to help Shepard this forward.
There's also https://github.com/bazelbuild/bazel-gazelle/pull/1888, so @TvdW and you might want to align.
There's also #1888, so @TvdW and you might want to align.
Indeed, I created mine after noticing that this one was not moving forward anymore. They do the same thing. Mine covers both build files and proto files, so if we land this one first it reduces the diff on mine. That said, I'm happy to push them both forward at the same time in my PR as well. Your call, @stefanpenner!