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

build image rule #43

Open
ns-ggeorgiev opened this issue Oct 24, 2023 · 12 comments
Open

build image rule #43

ns-ggeorgiev opened this issue Oct 24, 2023 · 12 comments

Comments

@ns-ggeorgiev
Copy link

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.

@srikrsna-buf
Copy link
Member

Could you elaborate a bit more how such a rule will work? Like how do you expect dependencies to be resolved?

@ns-ggeorgiev
Copy link
Author

if I can use the lint test as follows:

buf_lint_test(
    name = "ghjira_proto_lint",
    config = "//:buf.yaml",
    targets = [":ghjira_proto"],
)

I would like to be able to have the ability to create image with the same ease:

buf_image(
    name = "ghjira_proto_image",
    targets = [":ghjira_proto"],
)

@srikrsna-buf
Copy link
Member

srikrsna-buf commented Nov 6, 2023

Hey! In you example the target :ghjira_proto which comes from proto_library already has the file descriptor set

@ns-ggeorgiev
Copy link
Author

@srikrsna-buf How this relates to having a buf image?

@srikrsna-buf
Copy link
Member

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
Copy link
Author

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
Copy link
Member

If it is a rule then it will always build from the same source as buf_breaking_test and never detect any breaking changes.

@ns-ggeorgiev
Copy link
Author

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
Copy link
Member

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
Copy link
Author

yes, that will be great

@chandraaditya
Copy link

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
Copy link
Member

We are in the midst of some change to how build works, waiting for them to land before we add this rule.

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

No branches or pull requests

3 participants