Skip to content

Commit ff927f7

Browse files
c-parsonscopybara-github
authored andcommitted
Automated rollback of commit dadc49e.
*** Reason for rollback *** Breaks Tensorflow. See #16296 *** Original change description *** Apply graph_structure aspect across all edges RELNOTES: None. PiperOrigin-RevId: 480381529 Change-Id: Ied2f6b14a4b80e3c77691cf716c199b9c8a63f85
1 parent 9ba1ada commit ff927f7

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/main/starlark/builtins_bzl/common/cc/experimental_cc_shared_library.bzl

+5-15
Original file line numberDiff line numberDiff line change
@@ -586,21 +586,11 @@ def _cc_shared_library_impl(ctx):
586586
def _graph_structure_aspect_impl(target, ctx):
587587
children = []
588588

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])
604594

605595
# TODO(bazel-team): Add flag to Bazel that can toggle the initialization of
606596
# linkable_more_than_once.

0 commit comments

Comments
 (0)