Skip to content

Commit

Permalink
SCons: Fix potential error when pruning cache on CI
Browse files Browse the repository at this point in the history
This could cause spurious errors on CI when trying to prune the cache,
as for some reason it tries to remove files/paths which do not exist.

That points at a bug in the `cache_progress` logic but at least this
workaround should prevent CI failures.
  • Loading branch information
akien-mga committed Aug 18, 2021
1 parent f6626a4 commit 825b245
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,12 @@ def get_size(self, start_path="."):

def progress_finish(target, source, env):
nonlocal node_count, progressor
with open(node_count_fname, "w") as f:
f.write("%d\n" % node_count)
progressor.delete(progressor.file_list())
try:
with open(node_count_fname, "w") as f:
f.write("%d\n" % node_count)
progressor.delete(progressor.file_list())
except Exception:
pass

try:
with open(node_count_fname) as f:
Expand Down

0 comments on commit 825b245

Please sign in to comment.