From 0f5f472d7648677f32446080ec079784250c172e Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Tue, 8 May 2012 16:11:49 +0000 Subject: Defer installing chunk artifacts until we need them. We want to avoid installing anything into the staging area unless we actually need it. When building we now simply defer all install operations until we come across something we do not have cached and that we actually have to build. We then install everything we have encountered so far (either cached or built) and clear the list of what needs to be installed. The list of things to be installed in the future is populated at the end of processing a build group so that nothing built in the current group is installed until all other artifacts in the group have been built as well. --- morph | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'morph') diff --git a/morph b/morph index 3174a330..c91aad93 100755 --- a/morph +++ b/morph @@ -281,26 +281,30 @@ class Morph(cliapp.Application): if setup_proc: builder.setup_proc = True + to_be_installed = set() + for group in order.groups: for artifact in group: if artifact in needed: logging.debug('Need to build %s' % artifact.name) self.msg('Building %s' % artifact.name) + + for chunk_artifact in to_be_installed: + logging.debug('Installing %s' % chunk_artifact.name) + self.msg(' Installing %s' % chunk_artifact.name) + handle = lac.get(chunk_artifact) + staging_area.install_artifact(handle) + to_be_installed.clear() + builder.build_and_cache(artifact) else: logging.debug('No need to build %s' % artifact.name) self.msg('Using cached %s' % artifact.name) if install_chunks: - logging.debug('installing chunks from just-built group') - # install chunks only - chunk_artifacts = [x - for x in group - if x.source.morphology['kind'] == - 'chunk'] - for artifact in chunk_artifacts: - handle = lac.get(artifact) - staging_area.install_artifact(handle) + to_be_installed.update( + [x for x in group + if x.source.morphology['kind'] == 'chunk']) if staging_root != '/': staging_area.remove() -- cgit v1.2.1