You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think having a bazel rule that can create the buf image for a target is going to be extremely useful. Without it, I have to repeat all the bazel config in order to build the image.
Images are an extension of file descriptor sets. In the example that you proposed they are more or less the same. The one missing piece is the module info which will have information of the module this belongs to.
We have an unreleased push rule perhaps you are looking for something similar that builds the image?
I am not going to use the result for the rule form the current version, I am going to use the output of the rule to store in location from where I can pull it for the next execution
Okay, sounds good so you need a rule that builds the image for all you proto files as a single module, I think it will look similar to the push rule that I linked.
Activity
srikrsna-buf commentedon Nov 6, 2023
Could you elaborate a bit more how such a rule will work? Like how do you expect dependencies to be resolved?
ns-ggeorgiev commentedon Nov 6, 2023
if I can use the lint test as follows:
I would like to be able to have the ability to create image with the same ease:
srikrsna-buf commentedon Nov 6, 2023
Hey! In you example the target
:ghjira_protowhich comes fromproto_libraryalready has the file descriptor setns-ggeorgiev commentedon Nov 6, 2023
@srikrsna-buf How this relates to having a buf image?
srikrsna-buf commentedon Nov 7, 2023
Images are an extension of file descriptor sets. In the example that you proposed they are more or less the same. The one missing piece is the module info which will have information of the module this belongs to.
We have an unreleased push rule perhaps you are looking for something similar that builds the image?
ns-ggeorgiev commentedon Nov 7, 2023
I am looking for rule that can generate the file that I can store and later pass to the buf-breaking-test as against argument.
srikrsna-buf commentedon Nov 7, 2023
If it is a rule then it will always build from the same source as
buf_breaking_testand never detect any breaking changes.ns-ggeorgiev commentedon Nov 7, 2023
I am not going to use the result for the rule form the current version, I am going to use the output of the rule to store in location from where I can pull it for the next execution
srikrsna-buf commentedon Nov 7, 2023
Okay, sounds good so you need a rule that builds the image for all you proto files as a single module, I think it will look similar to the push rule that I linked.
ns-ggeorgiev commentedon Nov 7, 2023
yes, that will be great
chandraaditya commentedon Feb 23, 2024
I'm looking for such a rule as well for the exact same reason. Any update on if we can get that and if so when?
srikrsna-buf commentedon Feb 26, 2024
We are in the midst of some change to how build works, waiting for them to land before we add this rule.
srikrsna-buf commentedon May 7, 2025
To create a
buf_buildrule for v2 we will need bazelbuild/bazel#7989. I have an implementation that works with v1 config in a branch.In the meantime, you can run buf from bazel: