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
-
Starting with
buf
you 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 build
works ok for the module (afterbuf mod update
).But running
buf generate
from 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 generate
work 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
buf
workspaces 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 (example
directory is lost).Where did the
example
directory go? How can we get the same generated file structure as before?Generate each directory
It seems if you call
buf generate
on each directory containing.proto
files, you can also workaround the dependencies not being found.Like the workspace approach, the
example
directory is gone.Beta Was this translation helpful? Give feedback.
All reactions