forked from bazelbuild/rules_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove transition from binary/test/bench rules, add to grpc/proto
This mostly reverts commit a1d8936, removing the proc_macro_host_transition from most rules. This fixes bazelbuild#305, by no longer having a transition on rust_binary. It still solves bazelbuild#300 by adding this transition to rust_proto_library and rust_grpc_library. Those rules are meant to mirror rust_library, so they should share the same cfg values. Sharing the same configuration means that rust_proto_library or rust_grpc_library can be dependencies to rust_library or rust_binary and not cause another configuration of the library to be generated. The example introduced by bazelbuild#301 is moved in this commit into a subfolder to provide a more clear directory structure.
- Loading branch information
Showing
6 changed files
with
40 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,8 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@io_bazel_rules_rust//proto:proto.bzl", "rust_proto_library") | ||
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") | ||
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary") | ||
|
||
package(default_visibility = ["//proto:__subpackages__"]) | ||
|
||
proto_library( | ||
name = "common", | ||
srcs = ["common.proto"], | ||
) | ||
|
||
rust_proto_library( | ||
name = "common_proto_rust", | ||
deps = [":common"], | ||
) | ||
|
||
rust_library( | ||
name = "common_lib", | ||
srcs = ["lib.rs"], | ||
deps = [":common_proto_rust"], | ||
) | ||
|
||
rust_binary( | ||
name = "common_bin", | ||
srcs = ["main.rs"], | ||
deps = [ | ||
":common_lib", | ||
":common_proto_rust", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
load("@io_bazel_rules_rust//proto:proto.bzl", "rust_proto_library") | ||
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") | ||
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary") | ||
|
||
package(default_visibility = ["//proto:__subpackages__"]) | ||
|
||
rust_proto_library( | ||
name = "common_proto_rust", | ||
deps = ["//proto:common"], | ||
) | ||
|
||
rust_library( | ||
name = "common_lib", | ||
srcs = ["lib.rs"], | ||
deps = [":common_proto_rust"], | ||
) | ||
|
||
rust_binary( | ||
name = "common_bin", | ||
srcs = ["main.rs"], | ||
deps = [ | ||
":common_lib", | ||
":common_proto_rust", | ||
], | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters