summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-10-11 11:43:51 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-12 08:58:34 +0100
commit732007cbb627f648ce536554c28471f9acd58e9e (patch)
tree1442a4dfc16f3ba9ba4d5acef199ba24853ee277 /bitbake/lib/bb/build.py
parent9945923c8bc2479a72a913ee718ca823c69360b3 (diff)
downloadpoky-732007cbb627f648ce536554c28471f9acd58e9e.tar.gz
bitbake: bitbake: ensure -f causes dependent tasks to be re-run
If -f is specified, force dependent tasks to be re-run next time. This works by changing the force behaviour so that instead of deleting the task's stamp, we write a "taint" file into the stamps directory, which will alter the taskhash randomly and thus trigger the task to re-run next time we evaluate whether or not that should be done as well as influencing the taskhashes of any dependent tasks so that they are similarly re-triggered. As a bonus because we write this file as <stamp file name>.taskname.taint, the existing code which deletes the stamp files in OE's do_clean will already handle removing it. This means you can now do the following: bitbake somepackage [ change the source code in the package's WORKDIR ] bitbake -c compile -f somepackage bitbake somepackage and the result will be that all of the tasks that depend on do_compile (do_install, do_package, etc.) will be re-run in the last step. Note that to operate in the manner described above you need full hashing enabled (i.e. BB_SIGNATURE_HANDLER must be set to a signature handler that inherits from BasicHash). If this is not the case, -f will just delete the stamp for the specified task as it did before. This fix is required for [YOCTO #2615] and [YOCTO #2256]. (Bitbake rev: f7b55a94226f9acd985f87946e26d01bd86a35bb) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 95f1dcfcb7..f912a6bfe1 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -458,6 +458,24 @@ def del_stamp(task, d, file_name = None):
458 stamp = stamp_internal(task, d, file_name) 458 stamp = stamp_internal(task, d, file_name)
459 bb.utils.remove(stamp) 459 bb.utils.remove(stamp)
460 460
461def write_taint(task, d, file_name = None):
462 """
463 Creates a "taint" file which will force the specified task and its
464 dependents to be re-run the next time by influencing the value of its
465 taskhash.
466 (d can be a data dict or dataCache)
467 """
468 import uuid
469 if file_name:
470 taintfn = d.stamp[file_name] + '.' + task + '.taint'
471 else:
472 taintfn = d.getVar('STAMP', True) + '.' + task + '.taint'
473 bb.utils.mkdirhier(os.path.dirname(taintfn))
474 # The specific content of the taint file is not really important,
475 # we just need it to be random, so a random UUID is used
476 with open(taintfn, 'w') as taintf:
477 taintf.write(str(uuid.uuid4()))
478
461def stampfile(taskname, d, file_name = None): 479def stampfile(taskname, d, file_name = None):
462 """ 480 """
463 Return the stamp for a given task 481 Return the stamp for a given task