bufbuild / rules_buf

Bazel rules for Buf.
Apache License 2.0
47 stars 17 forks source link

Gazelle generates incorrect deps path to internal .proto dependencies in proto_library #27

Closed BeHustle closed 2 years ago

BeHustle commented 2 years ago

This happens if one buf.yaml file is used for several .proto libraries. In your example it happens in the following case:

srikrsna-buf commented 2 years ago

Hey @BeHustle! Thank you for the detailed steps to reproduce. I can confirm the behaviour that you highlighted.

After the changing the location of the buf.yaml, the import path for bar.proto changes to barapis/bar/v1/bar.proto. Updating fooapis/foo/v1/foo.proto to use the correct import path fixes the issue and gazelle accurately generates the rule.

As of now, if the gazelle extension cannot find the proto file at the import location it falls back to the dependency rule if present. It does not check whether the import is part of the dependency tree or not. I'll create an issue to track this and gazelle should return an error if this is the case.

Thank you for reporting. I'll close this issue and link this to the new issue. Feel free to reopen if I missed something.