2 ms·
Huh. As the person who literally implemented the original proto_library rule in Blaze (which was later publicly released as "Bazel"), I'm a bit surprised to lea
by kentonv 5y ago
Huh. As the person who literally implemented the original proto_library rule in Blaze (which was later publicly released as "Bazel"), I'm a bit surprised to learn this doesn't work well today... but admittedly I haven't had the opportunity to try Bazel since the public release. What is the story today?
- gravypod 5y ago`proto_library` for building the `.bin` file from protos works great. Generating stubs/messages for "all" languages does not. Each language does not want to implement gRPC rules, the gRPC team does not want to implement rules for each language. Sort of a deadlock situation. For example: - C++: https://github.com/grpc/grpc/blob/master/bazel/cc_grpc_library.bzl https://github.com/grpc/grpc/blob/master/bazel/cc_grpc_libra... - Python: https://github.com/grpc/grpc/blob/master/bazel/python_rules.bzl https://github.com/grpc/grpc/blob/master/bazel/python_rules.... - ObjC: https://github.com/grpc/grpc/blob/master/bazel/objc_grpc_library.bzl https://github.com/grpc/grpc/blob/master/bazel/objc_grpc_lib... - Java: https://github.com/grpc/grpc-java/blob/master/java_grpc_library.bzl https://github.com/grpc/grpc-java/blob/master/java_grpc_libr... - Go (different semantics than all of the other): https://github.com/bazelbuild/rules_go/blob/master/proto/def.bzl#L137 https://github.com/bazelbuild/rules_go/blob/master/proto/def... But there's also no real cohesion within the community. The biggest effort to date has been in https://github.com/stackb/rules_proto https://github.com/stackb/rules_proto which integrates with gazelle. tl;dr: Low alignment results in diverging implementations that are complicated to understand for newcomers. Buff's approach is much more appealing as it's a "this is the one way to do the right thing" and having it just work by detecting `proto_library` and doing all of the linting/registry stuff automagically in CI would be fantastic.