Replies: 1 comment
-
|
Thanks for the great question. I am facing this same scenario and arrived here for this very reason. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Starting with
bufyou might have a file structure like this:When you start to use dependencies (e.g.
google/api/annotations.proto), as mentioned in the tour,buf buildworks ok for the module (afterbuf mod update).But running
buf generatefrom the top-level won't use those dependencies. Here are some examples,The tour goes into pushing modules ot BSR and generating from those pushed modules (e.g.
buf generate buf.build/username/private-repo). But I simply want a tool that resolves these common dependencies. Not pushing our internal modules to BSR.Why can't
buf generatework when the local module is valid (according tobuf build)?I see others are confused too #922, #1570.
Workarounds
Workspaces
Everyone seems to end up switching to using
bufworkspaces so that dependencies work as expected without the step of needing to push modules to a repository to then be able to generate code.But that causes other problems, like generated code now goes to
gen/directly (exampledirectory is lost).Where did the
exampledirectory go? How can we get the same generated file structure as before?Generate each directory
It seems if you call
buf generateon each directory containing.protofiles, you can also workaround the dependencies not being found.Like the workspace approach, the
exampledirectory is gone.Beta Was this translation helpful? Give feedback.
All reactions