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

Allow protobuf-backed rust_proto_library to be used with bzlmod. #2584

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ use_repo(
"rules_rust_prost__tokio-1.28.2",
"rules_rust_prost__tokio-stream-0.1.14",
"rules_rust_prost__tonic-0.9.2",
"rules_rust_proto__grpc-0.6.2",
"rules_rust_proto__grpc-compiler-0.6.2",
"rules_rust_proto__log-0.4.17",
"rules_rust_proto__protobuf-2.8.2",
"rules_rust_proto__protobuf-codegen-2.8.2",
"rules_rust_proto__tls-api-0.1.22",
"rules_rust_proto__tls-api-stub-0.1.22",
"rules_rust_test_load_arbitrary_tool",
"rules_rust_tinyjson",
"rules_rust_toolchain_test_target_json",
Expand Down
13 changes: 12 additions & 1 deletion docs/flatten.md
Original file line number Diff line number Diff line change
Expand Up @@ -1876,11 +1876,22 @@ This macro should be called immediately after the `rust_protobuf_dependencies` m
## rust_proto_protobuf_dependencies

<pre>
rust_proto_protobuf_dependencies()
rust_proto_protobuf_dependencies(<a href="#rust_proto_protobuf_dependencies-bzlmod">bzlmod</a>)
</pre>

Declares repositories needed for protobuf.

**PARAMETERS**


| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="rust_proto_protobuf_dependencies-bzlmod"></a>bzlmod | Whether bzlmod is enabled. | `False` |

**RETURNS**

list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories
defined by this macro.


<a id="rust_proto_protobuf_register_toolchains"></a>
Expand Down
13 changes: 12 additions & 1 deletion docs/rust_proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,22 @@ This macro should be called immediately after the `rust_protobuf_dependencies` m
## rust_proto_protobuf_dependencies

<pre>
rust_proto_protobuf_dependencies()
rust_proto_protobuf_dependencies(<a href="#rust_proto_protobuf_dependencies-bzlmod">bzlmod</a>)
</pre>

Declares repositories needed for protobuf.

**PARAMETERS**


| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="rust_proto_protobuf_dependencies-bzlmod"></a>bzlmod | Whether bzlmod is enabled. | `False` |

**RETURNS**

list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories
defined by this macro.


<a id="rust_proto_protobuf_register_toolchains"></a>
Expand Down
1 change: 1 addition & 0 deletions examples/bzlmod/proto/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bazel-*
17 changes: 17 additions & 0 deletions examples/bzlmod/proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")

package(default_visibility = ["//visibility:public"])

build_test(
name = "gen_rust_project",
targets = [
"@rules_rust//tools/rust_analyzer:gen_rust_project",
],
)

build_test(
name = "rust_fmt",
targets = [
"@rules_rust//:rustfmt",
],
)
Loading