summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-10 13:59:54 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-11 16:04:44 +0000
commit868007ec418b126ab74d6899d6694aff23e8f50a (patch)
tree209eec3d998fffe5b53c2d09b3c4994cb350a256
parentd17c912ec302ebe6075b0dc1da95dceb7f84a435 (diff)
downloadmorph-868007ec418b126ab74d6899d6694aff23e8f50a.tar.gz
Remove an unnecessary caching step
The BuildCommand code walks the build graph and fetches or builds each artifact in order. So there's no need to fetch the dependencies of something once again when we come to building it: everything before it in the build graph has already been fetched or built.
-rw-r--r--morphlib/buildcommand.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index 1fce2950..ed131c74 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -288,7 +288,8 @@ class BuildCommand(object):
def maybe_cache_artifacts_locally(self, source):
try:
- self.cache_artifacts_locally([source])
+ self.rac.get_artifacts_for_source(
+ source, self.lac, status_cb=self.app.status)
except morphlib.remoteartifactcache.GetError as e:
# It's important to not hide the error, as the problem may be
# something unexpected like a loose network cable.
@@ -341,7 +342,6 @@ class BuildCommand(object):
self.fetch_sources(source)
deps = morphlib.artifact.find_all_deps(source.artifacts.values())
- self.cache_artifacts_locally(deps)
use_chroot = False
setup_mounts = False
@@ -391,12 +391,6 @@ class BuildCommand(object):
source.repo = self.lrc.get_updated_repo(repo_name, ref=source.sha1)
self.lrc.ensure_submodules(source.repo, source.sha1)
- def cache_artifacts_locally(self, sources):
- '''Get artifacts missing from local cache from remote cache.'''
-
- self.rac.get_artifacts_for_sources(
- sources, self.lac, status_cb=self.app.status)
-
def create_staging_area(self, build_env, use_chroot=True, extra_env={},
extra_path=[]):
'''Create the staging area for building a single artifact.'''