From 270da0609978ce6d269865b6bd451ec560a983ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 10 May 2018 11:23:01 +0200 Subject: Do not pull/fetch/build elements that are not required For `bst build --deps plan`, do not process elements in pull/fetch/build queues until they are requested by a reverse dependency. --- buildstream/_stream.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'buildstream/_stream.py') diff --git a/buildstream/_stream.py b/buildstream/_stream.py index 6bde4eb02..ca999ad6e 100644 --- a/buildstream/_stream.py +++ b/buildstream/_stream.py @@ -181,7 +181,8 @@ class Stream(): track_except_targets=track_except, track_cross_junctions=track_cross_junctions, use_artifact_config=True, - fetch_subprojects=True) + fetch_subprojects=True, + dynamic_plan=True) # Remove the tracking elements from the main targets elements = self._pipeline.subtract_elements(elements, track_elements) @@ -755,7 +756,8 @@ class Stream(): track_cross_junctions=False, use_artifact_config=False, artifact_remote_url=None, - fetch_subprojects=False): + fetch_subprojects=False, + dynamic_plan=False): # Load rewritable if we have any tracking selection to make rewritable = False @@ -806,6 +808,16 @@ class Stream(): selected, except_elements) + if selection == PipelineSelection.PLAN and dynamic_plan: + # We use a dynamic build plan, only request artifacts of top-level targets, + # others are requested dynamically as needed. + # This avoids pulling, fetching, or building unneeded build-only dependencies. + for element in elements: + element._set_required() + else: + for element in selected: + element._set_required() + return selected, track_selected # _message() -- cgit v1.2.1