summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-28 14:15:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-30 15:07:19 +0000
commit42487f069b0b6212a140ddbc92b9c586f6940dc2 (patch)
tree3eba410f752b965311cc67aca5a342e34c3d250c /bitbake/lib/bb
parent4dc7967cf9afdc27e96c05a5ed44870bb70f311a (diff)
downloadpoky-42487f069b0b6212a140ddbc92b9c586f6940dc2.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/cache.py15
1 files changed, 8 insertions, 7 deletions
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):
285 cls.save_map = {} 285 cls.save_map = {}
286 cls.save_count = 1 286 cls.save_count = 1
287 cls.restore_map = {} 287 cls.restore_map = {}
288 cls.restore_count = {}
289 288
290 @classmethod 289 @classmethod
291 def _save(cls, deps): 290 def _save(cls, deps):
@@ -294,11 +293,13 @@ class SiggenRecipeInfo(RecipeInfoCommon):
294 return deps 293 return deps
295 for dep in deps: 294 for dep in deps:
296 fs = deps[dep] 295 fs = deps[dep]
297 if fs in cls.save_map: 296 if fs is None:
297 ret.append((dep, None, None))
298 elif fs in cls.save_map:
298 ret.append((dep, None, cls.save_map[fs])) 299 ret.append((dep, None, cls.save_map[fs]))
299 else: 300 else:
300 cls.save_map[fs] = cls.save_count 301 cls.save_map[fs] = cls.save_count
301 ret.append((dep, fs, None)) 302 ret.append((dep, fs, cls.save_count))
302 cls.save_count = cls.save_count + 1 303 cls.save_count = cls.save_count + 1
303 return ret 304 return ret
304 305
@@ -309,18 +310,18 @@ class SiggenRecipeInfo(RecipeInfoCommon):
309 return deps 310 return deps
310 if pid not in cls.restore_map: 311 if pid not in cls.restore_map:
311 cls.restore_map[pid] = {} 312 cls.restore_map[pid] = {}
312 cls.restore_count[pid] = 1
313 map = cls.restore_map[pid] 313 map = cls.restore_map[pid]
314 for dep, fs, mapnum in deps: 314 for dep, fs, mapnum in deps:
315 if mapnum: 315 if fs is None and mapnum is None:
316 ret[dep] = None
317 elif fs is None:
316 ret[dep] = map[mapnum] 318 ret[dep] = map[mapnum]
317 else: 319 else:
318 try: 320 try:
319 fs = cls.store[fs] 321 fs = cls.store[fs]
320 except KeyError: 322 except KeyError:
321 cls.store[fs] = fs 323 cls.store[fs] = fs
322 map[cls.restore_count[pid]] = fs 324 map[mapnum] = fs
323 cls.restore_count[pid] = cls.restore_count[pid] + 1
324 ret[dep] = fs 325 ret[dep] = fs
325 return ret 326 return ret
326 327