[oe-commits] [bitbake] 01/02: cooker: fix always loading cache on every UI start with memres

git at git.openembedded.org git at git.openembedded.org
Wed Jun 14 10:16:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 18dfd144d0da6ff662308ce4f9d135dc11412133
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Wed Jun 14 12:10:24 2017 +0200

    cooker: fix always loading cache on every UI start with memres
    
    The main point of memory resident bitbake is to avoid loading data
    unnecessarily on every bitbake invocation. Unfortunately the code that
    updated options from the UI was simply treating the fact that either
    of the "prefile" or "postfile" options were in the list of options
    passed in as an indication that the configuration was invalid, which was
    bad because these are always passed in. We only need to mark the
    configuration as invalid and thus reload it (and thus reload the cache)
    if the option value has actually changed.
    
    At the same time, the recently handled "tracking" option needs to be
    treated in a similar manner since the configuration needs to be reparsed
    if that has changed. Also, add a few extra debug messages to aid
    debugging this code in future.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 661cd0e..6a1b649 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -415,17 +415,24 @@ class BBCooker:
         self.ui_cmdline = cmdline
         clean = True
         for o in options:
-            if o in ['prefile', 'postfile']:
-                clean = False
-                server_val = getattr(self.configuration, "%s_server" % o)
+            if o in ['prefile', 'postfile', 'tracking']:
+                server_val = getattr(self.configuration, "%s_server" % o, None)
                 if not options[o] and server_val:
                     # restore value provided on server start
+                    logger.debug(1, "Restoring server value for option '%s'" % o)
                     setattr(self.configuration, o, server_val)
+                    clean = False
+                    continue
+                if getattr(self.configuration, o) == options[o]:
+                    # Value is the same, no need to mark dirty
                     continue
+                else:
+                    logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o]))
+                    clean = False
             setattr(self.configuration, o, options[o])
         for k in bb.utils.approved_variables():
             if k in environment and k not in self.configuration.env:
-                logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k]))
+                logger.debug(1, "Updating new environment variable %s to %s" % (k, environment[k]))
                 self.configuration.env[k] = environment[k]
                 clean = False
             if k in self.configuration.env and k not in environment:
@@ -435,7 +442,7 @@ class BBCooker:
             if k not in self.configuration.env and k not in environment:
                  continue
             if environment[k] != self.configuration.env[k]:
-                logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k]))
+                logger.debug(1, "Updating environment variable %s from %s to %s" % (k, self.configuration.env[k], environment[k]))
                 self.configuration.env[k] = environment[k]
                 clean = False
         if not clean:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list