rules_proto_grpc/rust
Paul Stemmet 87aee8e13b
rust: refactor {prost_proto|tonic_grpc}_library macros
So, I think I understand where the original work is coming from, but
fundamentally disagree with its implementation.

The idea was to create "drop in" macros that you can use to easily
create rust pb bindings, abstracting over the varied and complex tooling
that the rust ecosystem requires.

I believe this to be a mistake:

1. Potential for version mismatch for rlib symbols

    Anyone who remembers the "bad old days" of tokio 0.x (and futures
    0.1, for that matter) knows the pain of attempting to link against
    two different versions of the same symbol, because some dep you have
    is using an older version of the exported symbol.

    The use of "bundled" fallbacks in the varied xxx_dep(s) macro args
    invite this same issue.

    Instead, callers should made aware of the needed deps and be
    required to provide their own, ensuring their projects remain
    coherent.

    The bundled should *only* be used for creating the needed binaries
    for protoc codegen

2. Focus on UX over documentation

    The entire //rust:... subsystem of this project is misleadingly
    documented, to the point that it is easier to simply read the
    entire code base, rather than the docs.

    There was an attempt to compensate for this via the examples/ and
    ease-of-use in the public macros and rules, however the lack of
    documentation leaves users that need to integrate with more complex
    monorepos completely confused about how to correctly satisfy the
    mandatory args, what expected values for these args are, etc

Therefore, this refactor of the top level *_library macros adds proper
documentation each, and simplifies the args and notifies the caller of
the requirements to call each macro.
2024-09-28 00:48:14 +00:00
..
3rdparty rust/3rdparty: crates_vendor repin 2024-09-27 18:24:36 +00:00
example Fix test failures due to ipv4/ipv6 mismatch 2023-09-08 11:38:51 +01:00
BUILD.bazel rust: fixup rust_prost_plugin tool label 2024-09-27 21:00:03 +00:00
common.bzl Align rulegen and buildifier 2023-09-08 12:20:17 +01:00
crate_deps.bzl Apply buildifier 2023-07-25 23:01:55 +01:00
defs.bzl Add crate rules to rust examples template 2023-06-24 22:38:01 +01:00
repositories.bzl Apply buildifier 2023-07-25 23:01:55 +01:00
rust_fixer.bzl Allow all clippy lints for generated code. 2023-12-05 12:22:26 +01:00
rust_fixer.sh Replace rust rules with new prost and tonic rules 2023-06-05 22:28:40 -07:00
rust_prost_proto_compile.bzl Move ProstProtoInfo into rust common.bzl 2023-07-26 22:43:14 +01:00
rust_prost_proto_library.bzl rust: refactor {prost_proto|tonic_grpc}_library macros 2024-09-28 00:48:14 +00:00
rust_tonic_grpc_compile.bzl Move ProstProtoInfo into rust common.bzl 2023-07-26 22:43:14 +01:00
rust_tonic_grpc_library.bzl rust: refactor {prost_proto|tonic_grpc}_library macros 2024-09-28 00:48:14 +00:00