juergbi commented on code in PR #2173:
URL: https://github.com/apache/buildstream/pull/2173#discussion_r3789052416


##########
src/buildstream/element.py:
##########
@@ -883,8 +883,8 @@ def _dependencies(self, scope: _Scope, *, recurse=True, 
visited=None):
                         yield dep
         else:
 
-            def visit(element, scope, visited):
-                if scope == _Scope.ALL:
+            def visit(element: Element, scope: _Scope, visited: 
tuple[BitMap,BitMap]) -> Generator[Element]:
+                if scope == _Scope.ALL: # The element, it's runtime and build 
dependencies

Review Comment:
   ```suggestion
                   if scope == _Scope.ALL: # The element, its runtime and build 
dependencies
   ```



##########
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'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)
-
-                elif scope == _Scope.RUN:
+                    # _Scope.BUILD intentionally excludes yielding the element 
itself.
+                elif scope == _Scope.RUN: # The element and it's runtime 
dependencies

Review Comment:
   ```suggestion
                   elif scope == _Scope.RUN: # The element and its 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