diff options
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r-- | src/buildstream/element.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index fee05ba2b..73c7dccbb 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -100,7 +100,7 @@ from .plugin import Plugin from .sandbox import SandboxFlags, SandboxCommandError from .sandbox._config import SandboxConfig from .sandbox._sandboxremote import SandboxRemote -from .types import Consistency, CoreWarnings, Scope, _CacheBuildTrees, _KeyStrength +from .types import CoreWarnings, Scope, _CacheBuildTrees, _KeyStrength from ._artifact import Artifact from .storage.directory import Directory @@ -257,7 +257,7 @@ class Element(Plugin): self.__strict_cache_key = None # Our cached cache key for strict builds self.__artifacts = context.artifactcache # Artifact cache self.__sourcecache = context.sourcecache # Source cache - self.__consistency = Consistency.INCONSISTENT # Cached overall consistency state + self.__is_resolved = False # Whether the source is fully resolved or not self.__assemble_scheduled = False # Element is scheduled to be assembled self.__assemble_done = False # Element is assembled self.__pull_done = False # Whether pull was attempted @@ -1277,7 +1277,7 @@ class Element(Plugin): # pull/build, however should not occur during initialization # (since we will eventualyl visit reverse dependencies during # our initialization anyway). - self.__update_source_state() + self.__update_resolved_state() # _get_display_key(): # @@ -1326,7 +1326,7 @@ class Element(Plugin): def _tracking_done(self): # Tracking may change the sources' refs, and therefore the # source state. We need to update source state. - self.__update_source_state() + self.__update_resolved_state() # Check whether sources are now cached. # This is done here so that we don't throw an exception trying to show the pipeline at the end @@ -2191,7 +2191,7 @@ class Element(Plugin): # Get whether all sources of the element are resolved # def _has_all_sources_resolved(self): - return self.__consistency >= Consistency.RESOLVED + return self.__is_resolved # _has_all_sources_cached() # @@ -2353,19 +2353,18 @@ class Element(Plugin): # __update_source_state() # - # Updates source consistency state + # Updates source's resolved state # # An element's source state must be resolved before it may compute # cache keys, because the source's ref, whether defined in yaml or # from the workspace, is a component of the element's cache keys. # - def __update_source_state(self): - # Determine overall consistency of the element + def __update_resolved_state(self): for source in self.__sources: if not source.is_resolved(): break else: - self.__consistency = Consistency.RESOLVED + self.__is_resolved = True self.__update_cache_keys() # __can_build_incrementally() @@ -3011,7 +3010,7 @@ class Element(Plugin): # Note that it does not update *all* cache keys - In non-strict mode, the # strong cache key is updated in __update_cache_key_non_strict() # - # If the element's consistency is Consistency.INCONSISTENT this is + # If the element's is not resolved, this is # a no-op (since inconsistent elements cannot have cache keys). # # The weak and strict cache keys will be calculated if not already |