Skip to content

Commit e6aea30

Browse files
authored
Use ProtoInfo instead of legacy .proto attr (#211)
* Use ProtoInfo instead of legacy .proto attr bazelbuild/bazel#7152
1 parent 851f70f commit e6aea30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

proto/proto.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ def _compute_proto_source_path(file, source_root_attr):
7474
return path
7575

7676
def _rust_proto_aspect_impl(target, ctx):
77-
if not hasattr(target, "proto"):
77+
if ProtoInfo not in target:
7878
return None
7979
source_root = ctx.rule.attr.proto_source_root
8080
if source_root and source_root[-1] != "/":
8181
source_root += "/"
8282

8383
sources = [
8484
_compute_proto_source_path(f, source_root)
85-
for f in target.proto.direct_sources
85+
for f in target[ProtoInfo].direct_sources
8686
]
8787
transitive_sources = [
8888
f[RustProtoProvider].transitive_proto_sources
@@ -195,7 +195,7 @@ rust_proto_library = rule(
195195
One crate for each proto_library will be created with the corresponding stubs.
196196
""",
197197
mandatory = True,
198-
providers = ["proto"],
198+
providers = [ProtoInfo],
199199
aspects = [_rust_proto_aspect],
200200
),
201201
"rust_deps": attr.label_list(

0 commit comments

Comments
 (0)