diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index de57dcb37b..f44eff4675 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1378,6 +1378,26 @@ class RunQueue: | |||
1378 | cache[tid] = iscurrent | 1378 | cache[tid] = iscurrent |
1379 | return iscurrent | 1379 | return iscurrent |
1380 | 1380 | ||
1381 | def validate_hash(self, *, sq_fn, sq_task, sq_hash, sq_hashfn, siginfo, sq_unihash, d): | ||
1382 | locs = {"sq_fn" : sq_fn, "sq_task" : sq_task, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, | ||
1383 | "sq_unihash" : sq_unihash, "siginfo" : siginfo, "d" : d} | ||
1384 | |||
1385 | hashvalidate_args = ("(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=siginfo, sq_unihash=sq_unihash)", | ||
1386 | "(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=siginfo)", | ||
1387 | "(sq_fn, sq_task, sq_hash, sq_hashfn, d)") | ||
1388 | |||
1389 | for args in hashvalidate_args[:-1]: | ||
1390 | try: | ||
1391 | call = self.hashvalidate + args | ||
1392 | return bb.utils.better_eval(call, locs) | ||
1393 | except TypeError: | ||
1394 | continue | ||
1395 | |||
1396 | # Call the last entry without a try...catch to propagate any thrown | ||
1397 | # TypeError | ||
1398 | call = self.hashvalidate + hashvalidate_args[-1] | ||
1399 | return bb.utils.better_eval(call, locs) | ||
1400 | |||
1381 | def _execute_runqueue(self): | 1401 | def _execute_runqueue(self): |
1382 | """ | 1402 | """ |
1383 | Run the tasks in a queue prepared by rqdata.prepare() | 1403 | Run the tasks in a queue prepared by rqdata.prepare() |
@@ -1549,6 +1569,7 @@ class RunQueue: | |||
1549 | valid = [] | 1569 | valid = [] |
1550 | sq_hash = [] | 1570 | sq_hash = [] |
1551 | sq_hashfn = [] | 1571 | sq_hashfn = [] |
1572 | sq_unihash = [] | ||
1552 | sq_fn = [] | 1573 | sq_fn = [] |
1553 | sq_taskname = [] | 1574 | sq_taskname = [] |
1554 | sq_task = [] | 1575 | sq_task = [] |
@@ -1567,16 +1588,13 @@ class RunQueue: | |||
1567 | sq_fn.append(fn) | 1588 | sq_fn.append(fn) |
1568 | sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn]) | 1589 | sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn]) |
1569 | sq_hash.append(self.rqdata.runtaskentries[tid].hash) | 1590 | sq_hash.append(self.rqdata.runtaskentries[tid].hash) |
1591 | sq_unihash.append(self.rqdata.runtaskentries[tid].unihash) | ||
1570 | sq_taskname.append(taskname) | 1592 | sq_taskname.append(taskname) |
1571 | sq_task.append(tid) | 1593 | sq_task.append(tid) |
1572 | locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data } | 1594 | |
1573 | try: | 1595 | valid = self.validate_hash(sq_fn=sq_fn, sq_task=sq_taskname, sq_hash=sq_hash, sq_hashfn=sq_hashfn, |
1574 | call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=True)" | 1596 | siginfo=True, sq_unihash=sq_unihash, d=self.cooker.data) |
1575 | valid = bb.utils.better_eval(call, locs) | 1597 | |
1576 | # Handle version with no siginfo parameter | ||
1577 | except TypeError: | ||
1578 | call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)" | ||
1579 | valid = bb.utils.better_eval(call, locs) | ||
1580 | for v in valid: | 1598 | for v in valid: |
1581 | valid_new.add(sq_task[v]) | 1599 | valid_new.add(sq_task[v]) |
1582 | 1600 | ||
@@ -2293,6 +2311,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2293 | if self.rq.hashvalidate: | 2311 | if self.rq.hashvalidate: |
2294 | sq_hash = [] | 2312 | sq_hash = [] |
2295 | sq_hashfn = [] | 2313 | sq_hashfn = [] |
2314 | sq_unihash = [] | ||
2296 | sq_fn = [] | 2315 | sq_fn = [] |
2297 | sq_taskname = [] | 2316 | sq_taskname = [] |
2298 | sq_task = [] | 2317 | sq_task = [] |
@@ -2324,14 +2343,14 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2324 | sq_fn.append(fn) | 2343 | sq_fn.append(fn) |
2325 | sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn]) | 2344 | sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn]) |
2326 | sq_hash.append(self.rqdata.runtaskentries[tid].hash) | 2345 | sq_hash.append(self.rqdata.runtaskentries[tid].hash) |
2346 | sq_unihash.append(self.rqdata.runtaskentries[tid].unihash) | ||
2327 | sq_taskname.append(taskname) | 2347 | sq_taskname.append(taskname) |
2328 | sq_task.append(tid) | 2348 | sq_task.append(tid) |
2329 | 2349 | ||
2330 | self.cooker.data.setVar("BB_SETSCENE_STAMPCURRENT_COUNT", len(stamppresent)) | 2350 | self.cooker.data.setVar("BB_SETSCENE_STAMPCURRENT_COUNT", len(stamppresent)) |
2331 | 2351 | ||
2332 | call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)" | 2352 | valid = self.rq.validate_hash(sq_fn=sq_fn, sq_task=sq_taskname, sq_hash=sq_hash, sq_hashfn=sq_hashfn, |
2333 | locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data } | 2353 | siginfo=False, sq_unihash=sq_unihash, d=self.cooker.data) |
2334 | valid = bb.utils.better_eval(call, locs) | ||
2335 | 2354 | ||
2336 | self.cooker.data.delVar("BB_SETSCENE_STAMPCURRENT_COUNT") | 2355 | self.cooker.data.delVar("BB_SETSCENE_STAMPCURRENT_COUNT") |
2337 | 2356 | ||