diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-06-09 15:34:44 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:07:39 +0100 |
commit | 67f676f70449273f0f3e686d0c88999e482cc964 (patch) | |
tree | fe5d1cba9d5d26b60a951aee2d4844d4c8802670 /bitbake | |
parent | 453835679ba36b2e07f7aa8aa653a8cfeda95675 (diff) | |
download | poky-67f676f70449273f0f3e686d0c88999e482cc964.tar.gz |
bitbake: 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].
(Bitbake rev: fe4f3487368bc35043a1ba464e1c69d2c9cbefc6)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8846690a70..651b9c0a78 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1313,6 +1313,18 @@ class BBCooker: | |||
1313 | self.data.setVar("DATE", time.strftime('%Y%m%d', t)) | 1313 | self.data.setVar("DATE", time.strftime('%Y%m%d', t)) |
1314 | self.data.setVar("TIME", time.strftime('%H%M%S', t)) | 1314 | self.data.setVar("TIME", time.strftime('%H%M%S', t)) |
1315 | 1315 | ||
1316 | def reset_mtime_caches(self): | ||
1317 | """ | ||
1318 | Reset mtime caches - this is particularly important when memory resident as something | ||
1319 | which is cached is not unlikely to have changed since the last invocation (e.g. a | ||
1320 | file associated with a recipe might have been modified by the user). | ||
1321 | """ | ||
1322 | build.reset_cache() | ||
1323 | bb.fetch._checksum_cache.mtime_cache.clear() | ||
1324 | siggen_cache = getattr(bb.parse.siggen, 'checksum_cache', None) | ||
1325 | if siggen_cache: | ||
1326 | bb.parse.siggen.checksum_cache.mtime_cache.clear() | ||
1327 | |||
1316 | def matchFiles(self, bf): | 1328 | def matchFiles(self, bf): |
1317 | """ | 1329 | """ |
1318 | Find the .bb files which match the expression in 'buildfile'. | 1330 | Find the .bb files which match the expression in 'buildfile'. |
@@ -1490,7 +1502,7 @@ class BBCooker: | |||
1490 | return True | 1502 | return True |
1491 | return retval | 1503 | return retval |
1492 | 1504 | ||
1493 | build.reset_cache() | 1505 | self.reset_mtime_caches() |
1494 | self.buildSetVars() | 1506 | self.buildSetVars() |
1495 | 1507 | ||
1496 | # If we are told to do the None task then query the default task | 1508 | # If we are told to do the None task then query the default task |