diff options
author | Jürg Billeter <j@bitron.ch> | 2019-03-26 09:14:42 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-04-12 11:17:33 +0200 |
commit | b1cbd2a704b7d66143658466f7dcef1809d10d61 (patch) | |
tree | 40cbbf3533d04f880a0a93ed02e51c48142a6f52 | |
parent | 30769028860da65af8967250cdf7679bbcc0c7b1 (diff) | |
download | buildstream-b1cbd2a704b7d66143658466f7dcef1809d10d61.tar.gz |
element.py: Add _set_artifact_files_required() method
This will be used to allow build sessions with a partial local CAS when
using remote execution.
-rw-r--r-- | buildstream/element.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 0dbb91148..d4c4aa0b1 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -227,6 +227,7 @@ class Element(Plugin): self.__staged_sources_directory = None # Location where Element.stage_sources() was called self.__tainted = None # Whether the artifact is tainted and should not be shared self.__required = False # Whether the artifact is required in the current session + self.__artifact_files_required = False # Whether artifact files are required in the local cache self.__build_result = None # The result of assembling this Element (success, description, detail) self._build_log_path = None # The path of the build log for this Element self.__artifact = Artifact(self, context) # Artifact class for direct artifact composite interaction @@ -1556,6 +1557,29 @@ class Element(Plugin): def _is_required(self): return self.__required + # _set_artifact_files_required(): + # + # Mark artifact files for this element and its runtime dependencies as + # required in the local cache. + # + def _set_artifact_files_required(self): + if self.__artifact_files_required: + # Already done + return + + self.__artifact_files_required = True + + # Request artifact files of runtime dependencies + for dep in self.dependencies(Scope.RUN, recurse=False): + dep._set_artifact_files_required() + + # _artifact_files_required(): + # + # Returns whether artifact files for this element have been marked as required. + # + def _artifact_files_required(self): + return self.__artifact_files_required + # _schedule_assemble(): # # This is called in the main process before the element is assembled |