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

Bazel rule #182

Open
doronrosenberg opened this issue Aug 4, 2022 · 3 comments
Open

Bazel rule #182

doronrosenberg opened this issue Aug 4, 2022 · 3 comments

Comments

@doronrosenberg
Copy link

A Bazel rule for protobuf-es would be very enticing for me as I've found the bazel/typescript/grpc world to be frustrating and trying to get non-rules_proto_grpc rules to work with Bazel was painful (and eventually gave up). I see that rules_proto_grpc already has some buf rules for linting/etc.

@timostamm
Copy link
Member

Hey Doron, apologies for the late reply.

We do have a rules_buf repository, but it does not include code generation. From what I've heard from our team, Bazel is quite peculiar about the inputs/outputs and much more restrictive than the proto plugin contract, making a general bazel rule for plugins practically impossible.

That means we would need a rule specific to protobuf-es, and at this point in time, this is out of scope for this project. I am happy to leave this issue open though, and if people express interest, we might be able to provide such a rule.

@timostamm
Copy link
Member

We have added a plugin option to keep empty files in #229, making it easier to integrate with Bazel:

keep_empty_files=true

By default, protoc-gen-es (and all other plugins based on @bufbuild/protoplugin) omit empty files from the plugin output. This option disables pruning of empty files, to allow for smooth interoperation with Bazel and similar tooling that requires all output files to be declared ahead of time.

@alexeagle
Copy link

Hi, good news, my company is working on this now.

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