summaryrefslogtreecommitdiff
path: root/morphlib/builder2.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-07-06 10:56:17 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-07-06 11:06:22 +0000
commit11fa2bc851ed07282134258ea58843a8fd63f8fb (patch)
tree17b5e4c7a601472e0d5de37487d8da247dca141d /morphlib/builder2.py
parent16e67d1ca8676afa76bc089de6976bbd78ab7a85 (diff)
downloadmorph-11fa2bc851ed07282134258ea58843a8fd63f8fb.tar.gz
ChunkBuilder: write output of build to cache
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r--morphlib/builder2.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 301890b2..1feb3669 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -250,7 +250,10 @@ class ChunkBuilder(BuilderBase):
builddir = self.staging_area.builddir(self.artifact.source)
self.get_sources(builddir)
destdir = self.staging_area.destdir(self.artifact.source)
- self.run_commands(builddir, destdir)
+ with self.local_artifact_cache.put_source_metadata(
+ self.artifact.source, self.artifact.cache_key,
+ 'build-log') as log:
+ self.run_commands(builddir, destdir, log)
except:
self.do_unmounts(mounted)
raise
@@ -335,7 +338,7 @@ class ChunkBuilder(BuilderBase):
os.utime(pathname, (now, now))
os.utime(dirname, (now, now))
- def run_commands(self, builddir, destdir): # pragma: no cover
+ def run_commands(self, builddir, destdir, logfile): # pragma: no cover
m = self.artifact.source.morphology
bs = morphlib.buildsystem.lookup_build_system(m['build-system'])
@@ -361,7 +364,10 @@ class ChunkBuilder(BuilderBase):
self.build_env.env['MAKEFLAGS'] = '-j%s' % max_jobs
else:
self.build_env.env['MAKEFLAGS'] = '-j1'
- self.runcmd(['sh', '-c', cmd], cwd=relative_builddir)
+ self.runcmd(['sh', '-c', cmd],
+ cwd=relative_builddir,
+ stdout=logfile,
+ stderr=logfile)
def assemble_chunk_artifacts(self, destdir): # pragma: no cover
built_artifacts = []