Patchwork [bitbake-devel] bitbake: btibake server must reparse the conf between builds

login
register
mail settings
Submitter Cristiana Voicu
Date Nov. 29, 2013, 11:31 a.m.
Message ID <1385724682-2289-1-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/62555/
State New
Headers show

Comments

Cristiana Voicu - Nov. 29, 2013, 11:31 a.m.
When the UI event handlers are registered, the cooker reset is
triggered. In this way it doesn't affect the cooker state.

[YOCTO #5535]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/server/xmlrpc.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Alex Damian - Nov. 29, 2013, 2:29 p.m.
Apart from the misspell in the subject, I really like this patch :).

Very creative, simple, straight to the point :)

Alex


On Fri, Nov 29, 2013 at 11:31 AM, Cristiana Voicu <cristiana.voicu@intel.com
> wrote:

> When the UI event handlers are registered, the cooker reset is
> triggered. In this way it doesn't affect the cooker state.
>
> [YOCTO #5535]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/server/xmlrpc.py |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/bitbake/lib/bb/server/xmlrpc.py
> b/bitbake/lib/bb/server/xmlrpc.py
> index 82c0e8d..fb7a8b4 100644
> --- a/bitbake/lib/bb/server/xmlrpc.py
> +++ b/bitbake/lib/bb/server/xmlrpc.py
> @@ -103,8 +103,9 @@ class BitBakeServerCommands():
>          for f in featureset:
>              self.cooker.featureset.setFeature(f)
>
> -        if (original_featureset != list(self.cooker.featureset)):
> -            self.cooker.reset()
> +        #always reset the cooker when a remote UI Event Handler is
> registered,
> +        #in order to reparse the configuration files
> +        self.cooker.reset()
>
>          self.event_handle = bb.event.register_UIHhandler(s)
>          return self.event_handle
> --
> 1.7.9.5
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>
Richard Purdie - Dec. 2, 2013, 1:35 p.m.
On Fri, 2013-11-29 at 13:31 +0200, Cristiana Voicu wrote:
> When the UI event handlers are registered, the cooker reset is
> triggered. In this way it doesn't affect the cooker state.
> 
> [YOCTO #5535]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/server/xmlrpc.py |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
> index 82c0e8d..fb7a8b4 100644
> --- a/bitbake/lib/bb/server/xmlrpc.py
> +++ b/bitbake/lib/bb/server/xmlrpc.py
> @@ -103,8 +103,9 @@ class BitBakeServerCommands():
>          for f in featureset:
>              self.cooker.featureset.setFeature(f)
>  
> -        if (original_featureset != list(self.cooker.featureset)):
> -            self.cooker.reset()
> +        #always reset the cooker when a remote UI Event Handler is registered,
> +        #in order to reparse the configuration files
> +        self.cooker.reset()
>  
>          self.event_handle = bb.event.register_UIHhandler(s)
>          return self.event_handle

Whilst this is simple and solves the immediate problem, I don't think
this is going to scale. We need to properly fix the server reset paths
once and for all.

This is one of those "how deep does the rabbit hole go" type problems
though. I started looking at this and firstly got very confused that we
have both cooker.loadConfigurationData and cooker.initConfigurationData.
I think one is a hack to allow hob to inject pre/post config files to
the configuration. That appears to be backed up by the
parseConfigurationFiles() command. So to move forward we need to fix
those things.

What we need is a clear separation to setting up the configuration
(including the pre/post files), then actually parsing it. In due course
we can then put code around this to know when we need to invalidate the
cache and when we do not.

Specifically, I believe that we need to:

a) Merge cooker.loadConfigurationData and  cooker.initConfigurationData 
   into one single base datastore reset function
b) Have a setPrePostConfFiles command which sets the pre/post config 
   files which hob uses
c) Figure out which of the Async commands should be sync commands (I 
   suspect most of the find*() ones.

and once we've cleared up this tangled web, we can revisit the question
of where and when we should be triggering a reset.

Cheers,

Richard

Patch

diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 82c0e8d..fb7a8b4 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -103,8 +103,9 @@  class BitBakeServerCommands():
         for f in featureset:
             self.cooker.featureset.setFeature(f)
 
-        if (original_featureset != list(self.cooker.featureset)):
-            self.cooker.reset()
+        #always reset the cooker when a remote UI Event Handler is registered,
+        #in order to reparse the configuration files
+        self.cooker.reset()
 
         self.event_handle = bb.event.register_UIHhandler(s)
         return self.event_handle