aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-06-09 15:34:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-09 17:24:11 +0100
commitfe4f3487368bc35043a1ba464e1c69d2c9cbefc6 (patch)
tree6d1508571cb5e2efcfec42d4f48b48470557d7db /lib/bb/cooker.py
parent57d4977555cf892b15dd0302dfe261fe37d49327 (diff)
downloadbitbake-contrib-fe4f3487368bc35043a1ba464e1c69d2c9cbefc6.tar.gz
cooker: fix file changes not triggering task re-execution with memres
If you build a recipe, modify one of the files referred to in SRC_URI, then build it again, it should re-run do_fetch and the tasks that depend upon it to incorporate the modified file. With memory resident mode this was not working unless you restarted the server, because the mtime of the file was cached and thus we never checked the actual file. Clear out the mtime caches in buildTargets() to ensure this isn't an issue. I did a minor refactoring to break this out to its own function since we were already clearing out the build mtime cache here. (The test I used for this was . ./oe-init-build-env-memres, bitbake -c fetch mdadm, modify the comments at the top of one of the patches referred to in the recipe, and then bitbake -c fetch mdadm again and it should re-execute the fetch task ("... 0 didn't need to be re-run".) Fixes [YOCTO #10732]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 8846690a7..651b9c0a7 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1313,6 +1313,18 @@ class BBCooker:
self.data.setVar("DATE", time.strftime('%Y%m%d', t))
self.data.setVar("TIME", time.strftime('%H%M%S', t))
+ def reset_mtime_caches(self):
+ """
+ Reset mtime caches - this is particularly important when memory resident as something
+ which is cached is not unlikely to have changed since the last invocation (e.g. a
+ file associated with a recipe might have been modified by the user).
+ """
+ build.reset_cache()
+ bb.fetch._checksum_cache.mtime_cache.clear()
+ siggen_cache = getattr(bb.parse.siggen, 'checksum_cache', None)
+ if siggen_cache:
+ bb.parse.siggen.checksum_cache.mtime_cache.clear()
+
def matchFiles(self, bf):
"""
Find the .bb files which match the expression in 'buildfile'.
@@ -1490,7 +1502,7 @@ class BBCooker:
return True
return retval
- build.reset_cache()
+ self.reset_mtime_caches()
self.buildSetVars()
# If we are told to do the None task then query the default task