File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1174,20 +1174,27 @@ def get_all_link_deps(self) -> ImmutableListProtocol[BuildTargetTypes]:
11741174 at link time, see get_dependencies() for that.
11751175 """
11761176 result : OrderedSet [BuildTargetTypes ] = OrderedSet ()
1177+ nonresults : OrderedSet [BuildTargetTypes ] = OrderedSet ()
11771178 stack : T .Deque [BuildTargetTypes ] = deque ()
11781179 stack .appendleft (self )
11791180 while stack :
11801181 t = stack .pop ()
1181- if t in result :
1182+ if t in result or t in nonresults :
11821183 continue
11831184 if isinstance (t , CustomTargetIndex ):
11841185 stack .appendleft (t .target )
11851186 continue
11861187 if isinstance (t , SharedLibrary ):
11871188 result .add (t )
1189+ else :
1190+ nonresults .add (t )
11881191 if isinstance (t , BuildTarget ):
1189- stack .extendleft (t .link_targets )
1190- stack .extendleft (t .link_whole_targets )
1192+ for t2 in t .link_targets :
1193+ if t2 not in nonresults :
1194+ stack .appendleft (t2 )
1195+ for t2 in t .link_whole_targets :
1196+ if t2 not in nonresults :
1197+ stack .appendleft (t2 )
11911198 return list (result )
11921199
11931200 @lru_cache (maxsize = None )
You can’t perform that action at this time.
0 commit comments