• Home
  • Raw
  • Download

Lines Matching +full:toolchain +full:- +full:version

7 `rust_grpc_library` rules which generate Rust code using the [`rust-protobuf`] dependencies. 
9 [rust]: http://www.rust-lang.org/
10 [protobuf]: https://developers.google.com/protocol-buffers/
12 [`rust-protobuf`]: https://github.com/stepancheg/rust-protobuf/
28 The `prost` and `tonic` rules do not specify a default toolchain in order to avoid mismatched
29 dependency issues. To setup the `prost` and `tonic` toolchain, please see the section
30 [Customizing `prost` and `tonic` Dependencies](#custom-prost-deps).
34 #### <a name="custom-prost-deps">Customizing `prost` and `tonic` Dependencies
36 These rules depend on the [`prost`] and [`tonic`] dependencies. To setup the necessary toolchain
37 …se rules, you must define a toolchain with the [`prost`], [`prost-types`], [`tonic`], [`protoc-gen
40 [`prost-types`]: https://crates.io/crates/prost-types
41 [`protoc-gen-prost`]: https://crates.io/crates/protoc-gen-prost
42 [`protoc-gen-tonic`]: https://crates.io/crates/protoc-gen-tonic
55 "protoc-gen-prost": [crate.annotation(
56 gen_binaries = ["protoc-gen-prost"],
58 "-p1",
61 # Note: You will need to use this patch until a version greater than `0.2.2` of
62 # `protoc-gen-prost` is released.
63 "@rules_rust//proto/prost/private/3rdparty/patches:protoc-gen-prost.patch",
66 "protoc-gen-tonic": [crate.annotation(
67 gen_binaries = ["protoc-gen-tonic"],
74 version = "0",
76 "prost-types": crate.spec(
77 version = "0",
79 "protoc-gen-prost": crate.spec(
80 version = "0",
82 "protoc-gen-tonic": crate.spec(
83 version = "0",
86 version = "0",
94 You can then define a toolchain with the `rust_prost_toolchain` rule which uses the crates
118 prost_plugin = "@crates_io//:protoc-gen-prost__protoc-gen-prost",
120 prost_types = "@crates_io//:prost-types",
122 tonic_plugin = "@crates_io//:protoc-gen-tonic__protoc-gen-tonic",
126 toolchain(
128 toolchain = "prost_toolchain_impl",
133 Lastly, you must register the toolchain in your `WORKSPACE` file. For example:
139 ## Rust-Protobuf Setup
142 external repositories for the Rust proto toolchain (in addition to the [rust rules setup](..)):
156 This will load the required dependencies for the [`rust-protobuf`] rules. It will also
157 register a default toolchain for the `rust_proto_library` and `rust_grpc_library` rules.
159 To customize the `rust_proto_library` and `rust_grpc_library` toolchain, please see the section
160 [Customizing `rust-protobuf` Dependencies](#custom-proto-deps).
164 #### <a name="custom-proto-deps">Customizing `rust-protobuf` Dependencies
179 file to see the default dependencies), you need to create your own toolchain.
180 To do so you can create a BUILD file with your toolchain definition, for example:
183 load("@rules_rust//proto:toolchain.bzl", "rust_proto_toolchain")
186 name = "proto-toolchain-impl",
195 toolchain(
196 name = "proto-toolchain",
197 toolchain = ":proto-toolchain-impl",
202 Now that you have your own toolchain, you need to register it by
206 register_toolchains("//my/toolchains:proto-toolchain")
210 `rust_proto_library` and `rust_grpc_library` to change the compile-time
232 __Note__: Ideally, we would inject those dependencies from the toolchain,
234 all dependencies added via the toolchain ends-up being in the wrong
237 ---
238 ---