From 42487f069b0b6212a140ddbc92b9c586f6940dc2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 28 Dec 2022 14:15:51 +0000 Subject: bitbake: cache: Drop reciever side counting for SiggenRecipeInfo Joshua Watt pointed out maintaining the counting on both sides of the connection isn't needed. Remove the receiver side counting and simplify the code, also allowing errors if the counts do go out of sync. (Bitbake rev: aeacfd391903fe68ae600470fc2bbad0502d401e) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cache.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/cache.py') diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 3fc097241a..ee924b2d2b 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -285,7 +285,6 @@ class SiggenRecipeInfo(RecipeInfoCommon): cls.save_map = {} cls.save_count = 1 cls.restore_map = {} - cls.restore_count = {} @classmethod def _save(cls, deps): @@ -294,11 +293,13 @@ class SiggenRecipeInfo(RecipeInfoCommon): return deps for dep in deps: fs = deps[dep] - if fs in cls.save_map: + if fs is None: + ret.append((dep, None, None)) + elif fs in cls.save_map: ret.append((dep, None, cls.save_map[fs])) else: cls.save_map[fs] = cls.save_count - ret.append((dep, fs, None)) + ret.append((dep, fs, cls.save_count)) cls.save_count = cls.save_count + 1 return ret @@ -309,18 +310,18 @@ class SiggenRecipeInfo(RecipeInfoCommon): return deps if pid not in cls.restore_map: cls.restore_map[pid] = {} - cls.restore_count[pid] = 1 map = cls.restore_map[pid] for dep, fs, mapnum in deps: - if mapnum: + if fs is None and mapnum is None: + ret[dep] = None + elif fs is None: ret[dep] = map[mapnum] else: try: fs = cls.store[fs] except KeyError: cls.store[fs] = fs - map[cls.restore_count[pid]] = fs - cls.restore_count[pid] = cls.restore_count[pid] + 1 + map[mapnum] = fs ret[dep] = fs return ret -- cgit v1.2.3-54-g00ecf