Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language/proto: Missing dependencies with go_package grouping #1219

Closed
nickgooding opened this issue Mar 29, 2022 · 1 comment · Fixed by #1237
Closed

language/proto: Missing dependencies with go_package grouping #1219

nickgooding opened this issue Mar 29, 2022 · 1 comment · Fixed by #1237

Comments

@nickgooding
Copy link
Contributor

What version of gazelle are you using?

v0.25.0

What version of rules_go are you using?

v0.31.0

What version of Bazel are you using?

5.0, 5.1

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Mac OS 12.3, x86_64-apple-darwin21.1.0

What did you do?

Using Gazelle to generate proto_library and go_proto_library targets using gazelle:proto package and gazelle:proto_group go_package directives with Proto files that share a Proto package, but have separate Go packages. I've pushed a simple reproduction of the issue here: https://github.com/nickgooding/bazel-gazelle-1219-repro

What did you expect to see?

  • Generated proto_library and go_proto_library targets should be generated with appropriate deps
  • Generated proto_library and go_proto_library targets should be buildable

What did you see instead?

  • Generated proto_library and go_proto_library targets are missing deps for proto_library/go_proto_library targets that belong to the same Proto package but have different Go packages
  • Generated proto_library and go_proto_library targets fail to build due to the missing dependencies

Using git bisect, it appears that 6bbfc47 is the commit where these dependencies stopped being generated. A similar issue, #1157 was raised regarding per-file Proto mode, but the fix for that does not appear to have resolved the issue when using go_package grouping.

nickgooding added a commit to nickgooding/bazel-gazelle that referenced this issue Apr 12, 2022
Fixes an issue where dependencies would be missed in the case where an
import was of a proto file in the same directory but from a different
target, such an when using `proto_group`. This would cause Gazelle to
generate `proto_library` and `go_proto_library` targets that could not
be built.

Fixes bazelbuild#1219
@wyattanderson
Copy link

I can confirm that we're facing the same issue, introduced by the same commit, and that @nickgooding's PR fixes the issue for us. Thanks!

achew22 pushed a commit that referenced this issue Apr 20, 2022
Fixes an issue where dependencies would be missed in the case where an
import was of a proto file in the same directory but from a different
target, such an when using `proto_group`. This would cause Gazelle to
generate `proto_library` and `go_proto_library` targets that could not
be built.

Fixes #1219
nickgooding added a commit to nickgooding/rules_go that referenced this issue Jun 9, 2022
The latest generation of the Gazelle patch of go_googleapis
appears to have been performed with Gazelle v0.25.0, which includes an
unfortunate bug that means dependencies will be missing for some
proto_library targets (bazelbuild/bazel-gazelle#1219). The fix for this
has now been merged but not yet released, so I have run the generation
again with Gazelle built from bazelbuild/bazel-gazelle@0408bc8

Closes: bazelbuild#3192
nickgooding added a commit to nickgooding/rules_go that referenced this issue Jun 9, 2022
The latest generation of the Gazelle patch of go_googleapis
appears to have been performed with Gazelle v0.25.0, which includes an
unfortunate bug that means dependencies will be missing for some
proto_library targets (bazelbuild/bazel-gazelle#1219). The fix for this
has now been merged but not yet released, so I have run the generation
again with Gazelle built from bazelbuild/bazel-gazelle@0408bc8

Fixes bazelbuild#3192
linzhp pushed a commit to bazelbuild/rules_go that referenced this issue Jun 18, 2022
The latest generation of the Gazelle patch of go_googleapis
appears to have been performed with Gazelle v0.25.0, which includes an
unfortunate bug that means dependencies will be missing for some
proto_library targets (bazelbuild/bazel-gazelle#1219). The fix for this
has now been merged but not yet released, so I have run the generation
again with Gazelle built from bazelbuild/bazel-gazelle@0408bc8

Fixes #3192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants