aboutsummaryrefslogtreecommitdiffstats
path: root/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:41:12 +0100
commite026469b307522e5b6a680e0ae5587749d33dcae (patch)
tree2eecc6ac50b7220c96fe719ca9bd7735e0bacfa4 /lib/bb/build.py
parent55382f0aac84b8f81cad0b82053c0b8295c33e54 (diff)
downloadbitbake-e026469b307522e5b6a680e0ae5587749d33dcae.tar.gz
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/build.py')
-rw-r--r--lib/bb/build.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 82d22f716..85af42c68 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -470,11 +470,40 @@ def stamp_internal(taskname, d, file_name):
return stamp
+def stamp_cleanmask_internal(taskname, d, file_name):
+ """
+ Internal stamp helper function to generate stamp cleaning mask
+ Returns the stamp path+filename
+
+ In the bitbake core, d can be a CacheData and file_name will be set.
+ When called in task context, d will be a data store, file_name will not be set
+ """
+ taskflagname = taskname
+ if taskname.endswith("_setscene") and taskname != "do_setscene":
+ taskflagname = taskname.replace("_setscene", "")
+
+ if file_name:
+ stamp = d.stamp_base_clean[file_name].get(taskflagname) or d.stampclean[file_name]
+ extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
+ else:
+ stamp = d.getVarFlag(taskflagname, 'stamp-base-clean', True) or d.getVar('STAMPCLEAN', True)
+ file_name = d.getVar('BB_FILENAME', True)
+ extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
+
+ if not stamp:
+ return
+
+ return bb.parse.siggen.stampcleanmask(stamp, file_name, taskname, extrainfo)
+
def make_stamp(task, d, file_name = None):
"""
Creates/updates a stamp for a given task
(d can be a data dict or dataCache)
"""
+ cleanmask = stamp_cleanmask_internal(task, d, file_name)
+ if cleanmask:
+ bb.utils.remove(cleanmask)
+
stamp = stamp_internal(task, d, file_name)
# Remove the file and recreate to force timestamp
# change on broken NFS filesystems