File tree 1 file changed +5
-15
lines changed
src/main/starlark/builtins_bzl/common/cc
1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -586,21 +586,11 @@ def _cc_shared_library_impl(ctx):
586
586
def _graph_structure_aspect_impl (target , ctx ):
587
587
children = []
588
588
589
- # Collect graph structure info from any possible deplike attribute. The aspect
590
- # itself applies across every deplike attribute (attr_aspects is *), so enumerate
591
- # over all attributes and consume GraphNodeInfo if available.
592
- for fieldname in dir (ctx .rule .attr ):
593
- if fieldname == "_cc_toolchain" or fieldname == "target_compatible_with" :
594
- continue
595
- deps = getattr (ctx .rule .attr , fieldname , None )
596
- if type (deps ) == "list" :
597
- for dep in deps :
598
- if type (dep ) == "Target" and GraphNodeInfo in dep :
599
- children .append (dep [GraphNodeInfo ])
600
-
601
- # Single dep.
602
- elif type (deps ) == "Target" and GraphNodeInfo in deps :
603
- children .append (deps [GraphNodeInfo ])
589
+ # For now ignore cases when deps is of type label instead of label_list.
590
+ if hasattr (ctx .rule .attr , "deps" ) and type (ctx .rule .attr .deps ) != "Target" :
591
+ for dep in ctx .rule .attr .deps :
592
+ if GraphNodeInfo in dep :
593
+ children .append (dep [GraphNodeInfo ])
604
594
605
595
# TODO(bazel-team): Add flag to Bazel that can toggle the initialization of
606
596
# linkable_more_than_once.
You can’t perform that action at this time.
0 commit comments