summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-10-07 14:15:53 +0200
committerJürg Billeter <j@bitron.ch>2020-10-07 14:26:38 +0200
commit4d5c5f859c08e81488f48b1ff301fe39aed4e9c1 (patch)
tree7f822d955167bf42685ec8529ff17d5b6631b217
parent0758cc569c5c781ffd8fd2643cb0d4c31220543d (diff)
downloadbuildstream-4d5c5f859c08e81488f48b1ff301fe39aed4e9c1.tar.gz
element.py: Add optional scope parameter to _set_required()
-rw-r--r--src/buildstream/element.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 3df8894f0..c9480d4fc 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1557,10 +1557,13 @@ class Element(Plugin):
# _set_required():
#
- # Mark this element and its runtime dependencies as required.
+ # Mark this element and its dependencies as required.
# This unblocks pull/fetch/build.
#
- def _set_required(self):
+ # Args:
+ # scope (_Scope): The scope of dependencies to mark as required
+ #
+ def _set_required(self, scope=_Scope.RUN):
assert utils._is_main_process(), "This has an impact on all elements and must be run in the main process"
if self.__required:
@@ -1569,9 +1572,9 @@ class Element(Plugin):
self.__required = True
- # Request artifacts of runtime dependencies
- for dep in self._dependencies(_Scope.RUN, recurse=False):
- dep._set_required()
+ # Request artifacts of dependencies
+ for dep in self._dependencies(scope, recurse=False):
+ dep._set_required(scope=_Scope.RUN)
# When an element becomes required, it must be assembled for
# the current pipeline. `__schedule_assembly_when_necessary()`