Bug 1391476 - Print cache info; r?dustin
For forensic purposes.
MozReview-Commit-ID: 6pcOm90cPdw
--- a/taskcluster/docker/recipes/run-task
+++ b/taskcluster/docker/recipes/run-task
@@ -292,28 +292,34 @@ def main(args):
print('cache %s is not a directory; this should never happen')
return 1
requires_path = os.path.join(cache, '.cacherequires')
# The cache is empty. No validation necessary. Just set up our
# requirements file.
if not os.listdir(cache):
+ print_line(b'cache', b'cache %s is empty; writing requirements: '
+ b'%s\n' % (cache, b' '.join(sorted(our_requirements))))
+
with open(requires_path, 'wb') as fh:
fh.write(b'\n'.join(sorted(our_requirements)))
# And make it read-only as a precaution against deletion.
os.chmod(requires_path, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
# The cache has content and we have a requirements file. Validate
# requirements alignment.
elif os.path.exists(requires_path):
with open(requires_path, 'rb') as fh:
wanted_requirements = set(fh.read().splitlines())
+ print_line(b'cache', b'cache %s exists; requirements: %s\n' % (
+ cache, b' '.join(sorted(wanted_requirements))))
+
missing = wanted_requirements - our_requirements
if missing:
print('requirements for populated cache %s differ from '
'this task' % cache)
print('cache requirements: %s' % ' '.join(sorted(
wanted_requirements)))
print('our requirements: %s' % ' '.join(sorted(
our_requirements)))