bitbake: cooker/cache/parse: Implement pyinofity based reconfigure
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Apr 2015 14:57:02 +0000 (15:57 +0100)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 26 Jul 2015 13:13:55 +0000 (10:13 -0300)
commit6b0ead16151d969e93127c25a4ed9a918333e9e6
treed7d1c65789593aed82a5f912ace99c3976a8c2b1
parent8ee34c1975cc86a57e229b9cc9399045dabaf9fa
bitbake: cooker/cache/parse: Implement pyinofity based reconfigure

Memory resident bitbake has one current flaw, changes in the base configuration
are not noticed by bitbake. The parsing cache is also refreshed on each invocation
of bitbake (although the mtime cache is not cleared so its pointless).

This change adds in pyinotify support and adds two different watchers, one
for the base configuration and one for the parsed recipes.

Changes in the latter will trigger a reparse (and an update of the mtime cache).
The former will trigger a complete reload of the configuration.

Note that this code will also correctly handle creation of new configuration files
since the __depends and __base_depends variables already track these for cache
correctness purposes.

We could be a little more clever about parsing cache invalidation, right now we just
invalidate the whole thing and recheck. For now, its better than what we have and doesn't
seem to perform that badly though.

For education and QA purposes I can document a workflow that illustrates this:

$ source oe-init-build-env-memres
$ time bitbake bash
[base configuration is loaded, recipes are parsed, bash builds]
$ time bitbake bash
[command returns quickly since all caches are valid]
$ touch ../meta/classes/gettext.bbclass
$ time bitbake bash
[reparse is triggered, time is longer than above]
$ echo 'FOO = "1"' >> conf/local.conf
$ time bitbake bash
[reparse is triggered, but with a base configuration reload too]

As far as changes go, I like this one a lot, it makes memory resident bitbake
truly usable and may be the tweak we need to make it the default.

The new pyinotify dependency is covered in the previous commit.

(Bitbake rev: 0557d03c170fba8d7efe82be1b9641d0eb229213)

(Bitbake rev: 47809de6459deb346929e4ca6efa87a997cfcb38)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
bitbake/lib/bb/cache.py
bitbake/lib/bb/cooker.py
bitbake/lib/bb/parse/__init__.py