diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-08-11 18:29:02 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-08-13 16:38:33 +0900 |
commit | 830401ba6abbced060ceb5e833a5a76fea39a743 (patch) | |
tree | 12f96d582714f0a9c49939b3be7b478fb3340e66 /src/buildstream/_pipeline.py | |
parent | dca535f43947543ce2dbc46b2408ed566811270e (diff) | |
download | buildstream-830401ba6abbced060ceb5e833a5a76fea39a743.tar.gz |
element.py: Early return in _initialize_state()
Instead of having an assertion here, lets just have an early return
and make the __resolved_initial_state variable internal private
(with two leading underscores).
We also stop checking for it in _pipeline.py before resolving state.
Some background:
* We only defer _initialize_state() to a later stage because
it can be a resource intensive task which interrogates the
disk or the local CAS, thus we have the Pipeline iterate
over the instantiated elements and resolve them separately
for better user feedback.
* Some "first pass" elements must have their state initialized
earlier, i.e. the "link" and "junction" elements need to be
usable during the load sequence.
Diffstat (limited to 'src/buildstream/_pipeline.py')
-rw-r--r-- | src/buildstream/_pipeline.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py index 42579af85..340c12b1a 100644 --- a/src/buildstream/_pipeline.py +++ b/src/buildstream/_pipeline.py @@ -115,8 +115,7 @@ class Pipeline: # greater value. for element in self.dependencies(targets, Scope.ALL): # Determine initial element state. - if not element._resolved_initial_state: - element._initialize_state() + element._initialize_state() # We may already have Elements which are cached and have their runtimes # cached, if this is the case, we should immediately notify their reverse |