summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-18 11:32:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-20 11:48:38 +0100
commitd485d0b0e875c9f5161645647472ce72af8d322e (patch)
tree511c662104813c268361f808de5e13756b0574ed /bitbake/lib/bb/build.py
parenta4fd77db84c86b6953ddf48acb0dbba7508a2ac4 (diff)
downloadpoky-d485d0b0e875c9f5161645647472ce72af8d322e.tar.gz
bitbake: build/siggen: Add support for stamp 'clean' masks
Currently when we execute a task, we don't remove other potentially stale stamps. This can mean if you switch between two different versions of a recipe without a clean, the build can get very confused. This patch adds in functionality to allow a wildcard expression of stamp files to be removed when creating a new stamp file. This patch adds in the core of the code to enable this but it also requires metadata support to enable it. When writing this improvement I went through several different options but this was the only way I could find to allow things like noexec tasks to function correctly (where stamps need to be created without the data store). [YOCTO #2961] (Bitbake rev: e026469b307522e5b6a680e0ae5587749d33dcae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 82d22f7165..85af42c684 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -470,11 +470,40 @@ def stamp_internal(taskname, d, file_name):
470 470
471 return stamp 471 return stamp
472 472
473def stamp_cleanmask_internal(taskname, d, file_name):
474 """
475 Internal stamp helper function to generate stamp cleaning mask
476 Returns the stamp path+filename
477
478 In the bitbake core, d can be a CacheData and file_name will be set.
479 When called in task context, d will be a data store, file_name will not be set
480 """
481 taskflagname = taskname
482 if taskname.endswith("_setscene") and taskname != "do_setscene":
483 taskflagname = taskname.replace("_setscene", "")
484
485 if file_name:
486 stamp = d.stamp_base_clean[file_name].get(taskflagname) or d.stampclean[file_name]
487 extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
488 else:
489 stamp = d.getVarFlag(taskflagname, 'stamp-base-clean', True) or d.getVar('STAMPCLEAN', True)
490 file_name = d.getVar('BB_FILENAME', True)
491 extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
492
493 if not stamp:
494 return
495
496 return bb.parse.siggen.stampcleanmask(stamp, file_name, taskname, extrainfo)
497
473def make_stamp(task, d, file_name = None): 498def make_stamp(task, d, file_name = None):
474 """ 499 """
475 Creates/updates a stamp for a given task 500 Creates/updates a stamp for a given task
476 (d can be a data dict or dataCache) 501 (d can be a data dict or dataCache)
477 """ 502 """
503 cleanmask = stamp_cleanmask_internal(task, d, file_name)
504 if cleanmask:
505 bb.utils.remove(cleanmask)
506
478 stamp = stamp_internal(task, d, file_name) 507 stamp = stamp_internal(task, d, file_name)
479 # Remove the file and recreate to force timestamp 508 # Remove the file and recreate to force timestamp
480 # change on broken NFS filesystems 509 # change on broken NFS filesystems