summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2015-08-21 10:33:45 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2015-08-23 20:23:46 +0000
commit03b1d432d6ff27cc7893f8bad0e4e02e0ee30a75 (patch)
tree7e5ee52da96a9f57acd9b2544370d3e4695012ef
parentc3567f41dfb1b01d356ad319fac6e70864744a92 (diff)
downloadybd-revert-splits.tar.gz
Unpack race fixrevert-splits
Occasional multi-instance builds failed at stage1-gcc. Paul Martin identified that multiples couldbe trying to unpack at the same time.
-rw-r--r--cache.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.py b/cache.py
index 1103bbd..459068e 100644
--- a/cache.py
+++ b/cache.py
@@ -95,6 +95,11 @@ def cache(defs, this, full_root=False):
utils.make_deterministic_gztar_archive(cachefile, this['install'])
os.rename('%s.tar.gz' % cachefile, cachefile)
+ unpackdir = cachefile + '.unpacked'
+ os.makedirs(unpackdir)
+ if call(['tar', 'xf', cachefile, '--directory', unpackdir]):
+ app.exit(this, 'ERROR: Problem unpacking', cachefile)
+
try:
target = os.path.join(app.config['artifacts'], cache_key(defs, this))
os.rename(tmpdir, target)