Skip to content

Commit

Permalink
Updated proto rules to fetch dependencies using crate_universe (#1491)
Browse files Browse the repository at this point in the history
* Updated proto rules to fetch dependencies using crate_universe

* Regenerated dependencies

* Regenerate documentation
  • Loading branch information
UebelAndre committed Aug 2, 2022
1 parent 67e204f commit 83a03ab
Show file tree
Hide file tree
Showing 172 changed files with 11,191 additions and 6,801 deletions.
4 changes: 2 additions & 2 deletions docs/flatten.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,9 @@ See @rules_rust//proto:BUILD for examples of defining the toolchain.
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="rust_proto_toolchain-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="rust_proto_toolchain-edition"></a>edition | The edition used by the generated rust source. | String | optional | "" |
| <a id="rust_proto_toolchain-grpc_compile_deps"></a>grpc_compile_deps | The crates the generated grpc libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/raze:protobuf"), Label("//proto/raze:grpc"), Label("//proto/raze:tls_api"), Label("//proto/raze:tls_api_stub")] |
| <a id="rust_proto_toolchain-grpc_compile_deps"></a>grpc_compile_deps | The crates the generated grpc libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/3rdparty/crates:protobuf"), Label("//proto/3rdparty/crates:grpc"), Label("//proto/3rdparty/crates:tls-api"), Label("//proto/3rdparty/crates:tls-api-stub")] |
| <a id="rust_proto_toolchain-grpc_plugin"></a>grpc_plugin | The location of the Rust protobuf compiler plugin to generate rust gRPC stubs. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | //proto:protoc_gen_rust_grpc |
| <a id="rust_proto_toolchain-proto_compile_deps"></a>proto_compile_deps | The crates the generated protobuf libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/raze:protobuf")] |
| <a id="rust_proto_toolchain-proto_compile_deps"></a>proto_compile_deps | The crates the generated protobuf libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/3rdparty/crates:protobuf")] |
| <a id="rust_proto_toolchain-proto_plugin"></a>proto_plugin | The location of the Rust protobuf compiler plugin used to generate rust sources. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | //proto:protoc_gen_rust |
| <a id="rust_proto_toolchain-protoc"></a>protoc | The location of the <code>protoc</code> binary. It should be an executable target. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | @com_google_protobuf//:protoc |

Expand Down
4 changes: 2 additions & 2 deletions docs/rust_proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ See @rules_rust//proto:BUILD for examples of defining the toolchain.
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="rust_proto_toolchain-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="rust_proto_toolchain-edition"></a>edition | The edition used by the generated rust source. | String | optional | "" |
| <a id="rust_proto_toolchain-grpc_compile_deps"></a>grpc_compile_deps | The crates the generated grpc libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/raze:protobuf"), Label("//proto/raze:grpc"), Label("//proto/raze:tls_api"), Label("//proto/raze:tls_api_stub")] |
| <a id="rust_proto_toolchain-grpc_compile_deps"></a>grpc_compile_deps | The crates the generated grpc libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/3rdparty/crates:protobuf"), Label("//proto/3rdparty/crates:grpc"), Label("//proto/3rdparty/crates:tls-api"), Label("//proto/3rdparty/crates:tls-api-stub")] |
| <a id="rust_proto_toolchain-grpc_plugin"></a>grpc_plugin | The location of the Rust protobuf compiler plugin to generate rust gRPC stubs. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | //proto:protoc_gen_rust_grpc |
| <a id="rust_proto_toolchain-proto_compile_deps"></a>proto_compile_deps | The crates the generated protobuf libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/raze:protobuf")] |
| <a id="rust_proto_toolchain-proto_compile_deps"></a>proto_compile_deps | The crates the generated protobuf libraries depends on. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [Label("//proto/3rdparty/crates:protobuf")] |
| <a id="rust_proto_toolchain-proto_plugin"></a>proto_plugin | The location of the Rust protobuf compiler plugin used to generate rust sources. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | //proto:protoc_gen_rust |
| <a id="rust_proto_toolchain-protoc"></a>protoc | The location of the <code>protoc</code> binary. It should be an executable target. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | @com_google_protobuf//:protoc |

Expand Down
80 changes: 80 additions & 0 deletions proto/3rdparty/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//crate_universe:defs.bzl", "crate", "crates_vendor")

crates_vendor(
name = "crates_vendor",
annotations = {
"lazy_static": [crate.annotation(
rustc_flags = [
"--cfg=lazy_static_heap_impl",
],
)],
"protobuf": [crate.annotation(
patch_args = ["-p1"],
patches = ["@rules_rust//proto/3rdparty/patches:protobuf-2.8.2.patch"],
)],
},
cargo_lockfile = "Cargo.Bazel.lock",
mode = "remote",
packages = {
"grpc": crate.spec(
version = "0.6.2",
),
"grpc-compiler": crate.spec(
version = "0.6.2",
),
"log": crate.spec(
version = "0.4, 0.4.7",
),
"protobuf": crate.spec(
features = ["with-bytes"],
version = "2.8.2",
),
"protobuf-codegen": crate.spec(
version = "2.8.2",
),
"tls-api": crate.spec(
version = "0.1.22",
),
"tls-api-stub": crate.spec(
version = "0.1.22",
),
},
repository_name = "rules_rust_proto",
tags = ["manual"],
)

alias(
name = "wasm_bindgen_cli",
actual = "@rules_rust_wasm_bindgen_cli",
tags = ["manual"],
visibility = ["//visibility:public"],
)

alias(
name = "wasm_bindgen",
actual = "//wasm_bindgen/3rdparty/crates:wasm-bindgen",
visibility = ["//visibility:public"],
)

bzl_library(
name = "bzl_lib",
srcs = glob(["**/*.bzl"]) + [
"//proto/3rdparty/crates:defs.bzl",
"//proto/3rdparty/crates:crates.bzl",
],
visibility = ["//proto:__pkg__"],
)

filegroup(
name = "distro",
srcs = glob([
"*.bzl",
"*.bazel",
]) + [
"//proto/3rdparty/patches:distro",
"//proto/3rdparty/crates:srcs",
"Cargo.Bazel.lock",
],
visibility = ["//proto:__pkg__"],
)
Loading

0 comments on commit 83a03ab

Please sign in to comment.