From 86cde7d99f7abdffb94dc6c805675b088e22bac0 Mon Sep 17 00:00:00 2001 From: Marco Farrugia Date: Sat, 30 Mar 2019 15:51:09 -0400 Subject: [PATCH] Use ProtoInfo instead of legacy .proto attr https://github.com/bazelbuild/bazel/issues/7152 --- proto/proto.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/proto.bzl b/proto/proto.bzl index ef65b0dcec..3fdf916c76 100644 --- a/proto/proto.bzl +++ b/proto/proto.bzl @@ -74,7 +74,7 @@ def _compute_proto_source_path(file, source_root_attr): return path def _rust_proto_aspect_impl(target, ctx): - if not hasattr(target, "proto"): + if ProtoInfo not in target: return None source_root = ctx.rule.attr.proto_source_root if source_root and source_root[-1] != "/": @@ -82,7 +82,7 @@ def _rust_proto_aspect_impl(target, ctx): sources = [ _compute_proto_source_path(f, source_root) - for f in target.proto.direct_sources + for f in target[ProtoInfo]direct_sources ] transitive_sources = [ f[RustProtoProvider].transitive_proto_sources @@ -195,7 +195,7 @@ rust_proto_library = rule( One crate for each proto_library will be created with the corresponding stubs. """, mandatory = True, - providers = ["proto"], + providers = [ProtoInfo], aspects = [_rust_proto_aspect], ), "rust_deps": attr.label_list(