Skip to content

Commit dd983af

Browse files
Googlercopybara-github
authored andcommitted
Fix cc_bindings_from_rs aspect error by checking for deps attribute.
PiperOrigin-RevId: 900853153
1 parent c32a43f commit dd983af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cc_bindings_from_rs/bazel_support/cc_bindings_from_rust_rule.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _get_dep_bindings_infos(attr):
9494
"""
9595
return [
9696
dep[CcBindingsFromRustInfo]
97-
for dep in attr.deps + getattr(attr, "cc_deps", [])
97+
for dep in getattr(attr, "deps", []) + getattr(attr, "cc_deps", [])
9898
if CcBindingsFromRustInfo in dep
9999
]
100100

@@ -469,7 +469,7 @@ def _cc_bindings_from_rust_aspect_impl(target, ctx):
469469
dep_bindings_infos = _get_dep_bindings_infos(ctx.rule.attr)
470470
config = crate_name_to_library_config(
471471
aspect_hints = ctx.rule.attr.aspect_hints,
472-
deps = ctx.rule.attr.deps,
472+
deps = getattr(ctx.rule.attr, "deps", []),
473473
)
474474
bindings_info, features, config, output_depset = _generate_bindings(
475475
ctx,

0 commit comments

Comments
 (0)