summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-09-29 12:31:58 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-10-03 17:16:39 +0530
commitb5563d817bd635a9e5429dd6aa030f13872b1aad (patch)
tree16ed32c4441749ca51f11908a3a7df7892547b12
parent3193e623717290cdfcbdd49c6ec2949d9bb1f262 (diff)
gen-cache: Sprinkle some more logging
This helps debug issues with cache generation on the CI Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/950>
-rw-r--r--cerbero/commands/cache.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cerbero/commands/cache.py b/cerbero/commands/cache.py
index 42678eed..e87d0ebb 100644
--- a/cerbero/commands/cache.py
+++ b/cerbero/commands/cache.py
@@ -67,6 +67,7 @@ class BaseCache(Command):
tmpdir = tempfile.mkdtemp()
tmpfile = os.path.join(tmpdir, 'deps.json')
run_until_complete(shell.download(url, tmpfile))
+ m.message(f'{tmpfile} downloaded')
with open(tmpfile, 'r') as f:
resp = f.read()
@@ -137,11 +138,13 @@ class FetchCache(BaseCache):
def find_dep(self, deps, sha, allow_old=False):
for dep in deps:
if dep['commit'] == sha:
+ m.message(f"Matching cache file is {dep['url']}")
return dep
if allow_old:
m.message("Did not find cache for commit %s, looking for an older one...");
for dep in deps:
if self.get_git_sha_is_ancestor(dep['commit']):
+ m.message(f"Latest available cache file is {dep['url']}")
return dep
m.warning("Did not find any cache for commit %s" % sha)
else:
@@ -219,6 +222,7 @@ class GenCache(BaseCache):
cmd += ['--use-compress-program=xz --threads=0']
else:
cmd += ['--bzip2']
+ m.message(f'Generating cache file with {cmd!r}')
try:
shell.new_call(cmd)
url = self.make_url(config, args, '%s-%s' % (sha, self.get_deps_filename(config)))
@@ -230,7 +234,8 @@ class GenCache(BaseCache):
os.remove(deps_filepath)
os.remove(log_filepath)
raise
- m.message('build-dep cache generated as {}'.format(deps_filename))
+ fsize = os.path.getsize(deps_filepath) / (1024 * 1024)
+ m.message(f'build-dep cache {deps_filepath} of size {fsize}MB generated')
def run(self, config, args):
BaseCache.run(self, config, args)