diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-18 11:32:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-20 11:48:38 +0100 |
commit | d485d0b0e875c9f5161645647472ce72af8d322e (patch) | |
tree | 511c662104813c268361f808de5e13756b0574ed /bitbake/lib/bb/siggen.py | |
parent | a4fd77db84c86b6953ddf48acb0dbba7508a2ac4 (diff) | |
download | poky-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/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 8fe59b9057..ff70d4ff4f 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -48,6 +48,9 @@ class SignatureGenerator(object): | |||
48 | def stampfile(self, stampbase, file_name, taskname, extrainfo): | 48 | def stampfile(self, stampbase, file_name, taskname, extrainfo): |
49 | return ("%s.%s.%s" % (stampbase, taskname, extrainfo)).rstrip('.') | 49 | return ("%s.%s.%s" % (stampbase, taskname, extrainfo)).rstrip('.') |
50 | 50 | ||
51 | def stampcleanmask(self, stampbase, file_name, taskname, extrainfo): | ||
52 | return ("%s.%s*.%s" % (stampbase, taskname, extrainfo)).rstrip('.') | ||
53 | |||
51 | def dump_sigtask(self, fn, task, stampbase, runtime): | 54 | def dump_sigtask(self, fn, task, stampbase, runtime): |
52 | return | 55 | return |
53 | 56 | ||
@@ -266,18 +269,24 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
266 | class SignatureGeneratorBasicHash(SignatureGeneratorBasic): | 269 | class SignatureGeneratorBasicHash(SignatureGeneratorBasic): |
267 | name = "basichash" | 270 | name = "basichash" |
268 | 271 | ||
269 | def stampfile(self, stampbase, fn, taskname, extrainfo): | 272 | def stampfile(self, stampbase, fn, taskname, extrainfo, clean=False): |
270 | if taskname != "do_setscene" and taskname.endswith("_setscene"): | 273 | if taskname != "do_setscene" and taskname.endswith("_setscene"): |
271 | k = fn + "." + taskname[:-9] | 274 | k = fn + "." + taskname[:-9] |
272 | else: | 275 | else: |
273 | k = fn + "." + taskname | 276 | k = fn + "." + taskname |
274 | if k in self.taskhash: | 277 | if clean: |
278 | h = "*" | ||
279 | taskname = taskname + "*" | ||
280 | elif k in self.taskhash: | ||
275 | h = self.taskhash[k] | 281 | h = self.taskhash[k] |
276 | else: | 282 | else: |
277 | # If k is not in basehash, then error | 283 | # If k is not in basehash, then error |
278 | h = self.basehash[k] | 284 | h = self.basehash[k] |
279 | return ("%s.%s.%s.%s" % (stampbase, taskname, h, extrainfo)).rstrip('.') | 285 | return ("%s.%s.%s.%s" % (stampbase, taskname, h, extrainfo)).rstrip('.') |
280 | 286 | ||
287 | def stampcleanmask(self, stampbase, fn, taskname, extrainfo): | ||
288 | return self.stampfile(stampbase, fn, taskname, extrainfo, clean=True) | ||
289 | |||
281 | def invalidate_task(self, task, d, fn): | 290 | def invalidate_task(self, task, d, fn): |
282 | bb.note("Tainting hash to force rebuild of task %s, %s" % (fn, task)) | 291 | bb.note("Tainting hash to force rebuild of task %s, %s" % (fn, task)) |
283 | bb.build.write_taint(task, d, fn) | 292 | bb.build.write_taint(task, d, fn) |