nathanwilliams-ct commented on code in PR #2173:
URL: https://github.com/apache/buildstream/pull/2173#discussion_r3767826706


##########
src/buildstream/element.py:
##########
@@ -893,22 +893,22 @@ def visit(element, scope, visited):
                             yield from visit(dep, _Scope.ALL, visited)
 
                     yield element
-                elif scope == _Scope.BUILD:
+                elif scope == _Scope.BUILD: # The element and it's build 
dependencies
                     visited[0].add(element._unique_id)
 
                     for dep in element.__build_dependencies:
                         if dep._unique_id not in visited[1]:
                             yield from visit(dep, _Scope.RUN, visited)
-
-                elif scope == _Scope.RUN:
+                    yield element
+                elif scope == _Scope.RUN: # The element and it's runtime 
dependencies
                     visited[1].add(element._unique_id)

Review Comment:
   ```suggestion
                   elif scope == _Scope.BUILD: # The element's build 
dependencies only
   visited[0].add(element._unique_id)
   
   for dep in element.__build_dependencies:
   if dep._unique_id not in visited[1]:
   yield from visit(dep, _Scope.RUN, visited)
                       # _Scope.BUILD intentionally excludes yield element here.
                   elif scope == _Scope.RUN: # The element and it's runtime 
dependencies
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to