summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-16 11:37:52 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-16 12:01:23 +0000
commit33d6e884b6dbf12ca71fd3b7c9cb108c95ff7fcd (patch)
tree89cfd92eeb2afb9ad352a3deb50c71e172cc9e22
parentb4276a90584832d38c0c6d6d2585a5ad3bc85966 (diff)
downloadmorph-tiagogomes/systems-build-time.tar.gz
WIP RFC Avoid fetching or building artifacts unnecessarilytiagogomes/systems-build-time
This patch modifies morph to adopt the following behaviour: If the root artifact is a system and it is cached, don't fetch or build the system's stratum and chunk artifacts. This will speed up building times if the system is cached, and will enable having an archive of deployable old systems, without having to keep around the system's chunk and stratum artifacts. TODO: option to control this behavior. Change-Id: I541cb375208e2091d271bcdc42f6d8a95ac977de
-rw-r--r--morphlib/buildcommand.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index a0922165..82080b8c 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -283,8 +283,22 @@ class BuildCommand(object):
def build_in_order(self, root_artifact):
'''Build everything specified in a build order.'''
+ # If the root artifact is a system and it is cached, don't fetch
+ # or build the system's stratum and chunk artifacts
+ if root_artifact.source.morphology['kind'] == 'system':
+ if self.rac is not None:
+ try:
+ self.cache_artifacts_locally([root_artifact])
+ except morphlib.remoteartifactcache.GetError:
+ pass
+ else:
+ return
+ if self.lac.has(root_artifact):
+ return
+
self.app.status(msg='Starting build of %(name)s',
name=root_artifact.source.name)
+
build_env = root_artifact.build_env
ordered_sources = list(self.get_ordered_sources(root_artifact.walk()))
old_prefix = self.app.status_prefix