-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
//proto
rules to provide all required dependencies. (#868)
- Loading branch information
1 parent
73f228f
commit fe657ed
Showing
18 changed files
with
131 additions
and
81 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
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
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,11 @@ | ||
"""Define transitive dependencies for `rules_rust` docs""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") | ||
load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories") | ||
load("@rules_rust//proto:transitive_repositories.bzl", "rust_proto_transitive_repositories") | ||
|
||
def transitive_deps(is_top_level = False): | ||
def transitive_deps(): | ||
"""Define transitive dependencies for `rules_rust` docs | ||
Args: | ||
is_top_level (bool, optional): Indicates wheather or not this is being called | ||
from the root WORKSPACE file of `rules_rust`. Defaults to False. | ||
""" | ||
rust_proto_repositories() | ||
rust_proto_transitive_repositories() | ||
|
||
node_repositories() | ||
|
||
# Rules proto does not declare a bzl_library, we stub it there for now. | ||
# TODO: Remove this hack if/when rules_proto adds a bzl_library. | ||
if is_top_level: | ||
maybe( | ||
native.local_repository, | ||
name = "rules_proto", | ||
path = "docs/rules_proto_stub", | ||
) | ||
else: | ||
maybe( | ||
native.local_repository, | ||
name = "rules_proto", | ||
path = "rules_proto_stub", | ||
) |
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
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,6 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
exports_files([ | ||
"com_google_protobuf-v3.10.0-bzl_visibility.patch", | ||
"rules_proto-bzl_visibility.patch", | ||
]) |
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,3 @@ | ||
# @rules_rust//proto patches | ||
|
||
The patches here provide the required visibility to `*.bzl` files used by the rules defined in `@rules_rust//proto`. |
14 changes: 14 additions & 0 deletions
14
proto/patches/com_google_protobuf-v3.10.0-bzl_visibility.patch
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,14 @@ | ||
diff --git a/BUILD b/BUILD | ||
index efc3d8e7f..77e3ea413 100644 | ||
--- a/BUILD | ||
+++ b/BUILD | ||
@@ -1236,3 +1236,9 @@ sh_test( | ||
"update_file_lists.sh", | ||
], | ||
) | ||
+ | ||
+filegroup( | ||
+ name = "bzl_srcs", | ||
+ srcs = glob(["**/*.bzl"]), | ||
+ visibility = ["//visibility:public"], | ||
+) |
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,19 @@ | ||
diff --git a/proto/BUILD b/proto/BUILD | ||
index 4856ada..67105f0 100644 | ||
--- a/proto/BUILD | ||
+++ b/proto/BUILD | ||
@@ -11,3 +11,14 @@ bzl_library( | ||
"//proto/private/rules:proto_descriptor_set", | ||
], | ||
) | ||
+ | ||
+bzl_library( | ||
+ name = "repositories", | ||
+ srcs = [ | ||
+ "repositories.bzl", | ||
+ ], | ||
+ visibility = ["//visibility:public"], | ||
+ deps = [ | ||
+ "//proto/private:dependencies", | ||
+ ], | ||
+) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""Definitions for loading transitive `@rules_rust//proto` dependencies""" | ||
|
||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") | ||
|
||
def rust_proto_transitive_repositories(): | ||
"""Load transitive dependencies of the `@rules_rust//proto` rules. | ||
This macro should be called immediately after the `rust_proto_repositories` macro. | ||
""" | ||
rules_proto_dependencies() | ||
|
||
rules_proto_toolchains() | ||
|
||
protobuf_deps() |