[bitbake-devel,1/1] command: Add command to invalidate parse cache

Submitted by Paul Eggleton on Sept. 12, 2017, 10:10 a.m. | Patch ID: 144003

Details

Message ID 2d7f1ec85c8242b1348597e7963b962efe562070.1505210965.git.paul.eggleton@linux.intel.com
State New
Headers show

Commit Message

Paul Eggleton Sept. 12, 2017, 10:10 a.m.
If we make a change to the metadata within a tinfoil-using script
and then attempt to run tasks using build_targets(), the change won't
get noticed. Add an explicit command that will set the internal flag to
force reloading the cache and thus pick up the changes. This will be
used in OE by the devtool source extraction rework.

Part of the fix for [YOCTO #11198].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/command.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 6c966e3..c3717ab 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -574,6 +574,9 @@  class CommandsSync:
         return DataStoreConnectionHandle(idx)
     parseRecipeFile.readonly = True
 
+    def invalidateParseCache(self, command, params):
+        command.cooker.parsecache_valid = False
+
 class CommandsAsync:
     """
     A class of asynchronous commands

Comments

Richard Purdie Sept. 12, 2017, 10:41 a.m.
On Tue, 2017-09-12 at 22:10 +1200, Paul Eggleton wrote:
> If we make a change to the metadata within a tinfoil-using script
> and then attempt to run tasks using build_targets(), the change won't
> get noticed. Add an explicit command that will set the internal flag
> to
> force reloading the cache and thus pick up the changes. This will be
> used in OE by the devtool source extraction rework.
> 
> Part of the fix for [YOCTO #11198].
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  lib/bb/command.py | 3 +++
>  1 file changed, 3 insertions(+)

Just a quick sanity check. Why won't the change get noticed? Any file
writes should be seen by the inotify code which would invalidate the
cache? This could mean we're not watching some dependency we should be?
or is it that the commands aren't triggering a reparse due to ordering
somehow? I'd like to understand this more before we add this...

Cheers,

Richard
Paul Eggleton Sept. 12, 2017, 11:05 a.m.
On Tuesday, 12 September 2017 10:41:36 PM NZST Richard Purdie wrote:
> On Tue, 2017-09-12 at 22:10 +1200, Paul Eggleton wrote:
> > If we make a change to the metadata within a tinfoil-using script
> > and then attempt to run tasks using build_targets(), the change won't
> > get noticed. Add an explicit command that will set the internal flag
> > to
> > force reloading the cache and thus pick up the changes. This will be
> > used in OE by the devtool source extraction rework.
> > 
> > Part of the fix for [YOCTO #11198].
> > 
> > Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> > ---
> >  lib/bb/command.py | 3 +++
> >  1 file changed, 3 insertions(+)
> 
> Just a quick sanity check. Why won't the change get noticed? Any file
> writes should be seen by the inotify code which would invalidate the
> cache? This could mean we're not watching some dependency we should be?
> or is it that the commands aren't triggering a reparse due to ordering
> somehow? I'd like to understand this more before we add this...

That's a good question, and you may well be right. I can look into it more 
closely.

Cheers,
Paul
Paul Eggleton Sept. 14, 2017, 4:09 a.m.
On Tuesday, 12 September 2017 11:05:50 PM NZST Paul Eggleton wrote:
> On Tuesday, 12 September 2017 10:41:36 PM NZST Richard Purdie wrote:
> > On Tue, 2017-09-12 at 22:10 +1200, Paul Eggleton wrote:
> > > If we make a change to the metadata within a tinfoil-using script
> > > and then attempt to run tasks using build_targets(), the change won't
> > > get noticed. Add an explicit command that will set the internal flag
> > > to
> > > force reloading the cache and thus pick up the changes. This will be
> > > used in OE by the devtool source extraction rework.
> > > 
> > > Part of the fix for [YOCTO #11198].
> > > 
> > > Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> > > ---
> > >  lib/bb/command.py | 3 +++
> > >  1 file changed, 3 insertions(+)
> > 
> > Just a quick sanity check. Why won't the change get noticed? Any file
> > writes should be seen by the inotify code which would invalidate the
> > cache? This could mean we're not watching some dependency we should be?
> > or is it that the commands aren't triggering a reparse due to ordering
> > somehow? I'd like to understand this more before we add this...
> 
> That's a good question, and you may well be right. I can look into it more 
> closely.

You were right - disregard this patch, I'm about to send a new series with a 
proper fix.

Cheers,
Paul