summaryrefslogtreecommitdiff
path: root/buildstream/_frontend
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-19 14:46:05 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-19 15:11:47 +0900
commit674378036f5389f319a712a58d0bae753af96067 (patch)
tree77cb278d92d30eca0629bfb0b12d2208c822f962 /buildstream/_frontend
parent64069c8c0bced53929db7171674991523accd764 (diff)
downloadbuildstream-674378036f5389f319a712a58d0bae753af96067.tar.gz
_pipeline.py, _frontend/app.py: Added track_selection initialization argument
This informs the pipeline what PipelineSelection mode to use for constructing the list of elements to track.
Diffstat (limited to 'buildstream/_frontend')
-rw-r--r--buildstream/_frontend/app.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index f4336956d..0f614f00f 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -38,7 +38,7 @@ from .._context import Context
from .._project import Project
from .._exceptions import BstError, PipelineError, LoadError, LoadErrorReason, AppError
from .._message import Message, MessageType, unconditional_messages
-from .._pipeline import Pipeline
+from .._pipeline import Pipeline, PipelineSelection
from .._scheduler import Scheduler
from .._profile import Topics, profile_start, profile_end
from .._versions import BST_FORMAT_VERSION
@@ -229,6 +229,7 @@ class App():
# add_remote_cache (str): The URL for an explicitly mentioned remote cache
# track_elements (list of elements): Elements which are to be tracked
# track_cross_junctions (bool): Whether tracking is allowed to cross junction boundaries
+ # track_selection (PipelineSelection): The selection algorithm for track elements
# fetch_subprojects (bool): Whether we should fetch subprojects as a part of the
# loading process, if they are not yet locally cached
#
@@ -243,8 +244,12 @@ class App():
@contextmanager
def initialized(self, elements, *, session_name=None,
except_=tuple(), rewritable=False,
- use_configured_remote_caches=False, add_remote_cache=None,
- track_elements=None, track_cross_junctions=False, fetch_subprojects=False):
+ use_configured_remote_caches=False,
+ add_remote_cache=None,
+ track_elements=None,
+ track_cross_junctions=False,
+ track_selection=PipelineSelection.ALL,
+ fetch_subprojects=False):
profile_start(Topics.LOAD_PIPELINE, "_".join(t.replace(os.sep, '-') for t in elements))
# Start with the early stage init, this enables logging right away
@@ -278,7 +283,8 @@ class App():
self.pipeline.initialize(use_configured_remote_caches=use_configured_remote_caches,
add_remote_cache=add_remote_cache,
track_elements=track_elements,
- track_cross_junctions=track_cross_junctions)
+ track_cross_junctions=track_cross_junctions,
+ track_selection=track_selection)
except BstError as e:
self._error_exit(e, "Error initializing pipeline")