diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-06-14 12:10:24 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-14 14:54:24 +0100 |
commit | 0cb0e96c946e9c7fa75a3cb2e48fd61e15f1d5e9 (patch) | |
tree | 6dde81f3b5f12cb2f02fe132ba2a3209d6943a2d /bitbake/lib/bb | |
parent | 68847d9ab5474ee47a4f9f67af0a31c18d91c48d (diff) | |
download | poky-0cb0e96c946e9c7fa75a3cb2e48fd61e15f1d5e9.tar.gz |
bitbake: 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.
(Bitbake rev: 18dfd144d0da6ff662308ce4f9d135dc11412133)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 661cd0e3c9..6a1b649f79 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -415,17 +415,24 @@ class BBCooker: | |||
415 | self.ui_cmdline = cmdline | 415 | self.ui_cmdline = cmdline |
416 | clean = True | 416 | clean = True |
417 | for o in options: | 417 | for o in options: |
418 | if o in ['prefile', 'postfile']: | 418 | if o in ['prefile', 'postfile', 'tracking']: |
419 | clean = False | 419 | server_val = getattr(self.configuration, "%s_server" % o, None) |
420 | server_val = getattr(self.configuration, "%s_server" % o) | ||
421 | if not options[o] and server_val: | 420 | if not options[o] and server_val: |
422 | # restore value provided on server start | 421 | # restore value provided on server start |
422 | logger.debug(1, "Restoring server value for option '%s'" % o) | ||
423 | setattr(self.configuration, o, server_val) | 423 | setattr(self.configuration, o, server_val) |
424 | clean = False | ||
425 | continue | ||
426 | if getattr(self.configuration, o) == options[o]: | ||
427 | # Value is the same, no need to mark dirty | ||
424 | continue | 428 | continue |
429 | else: | ||
430 | logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) | ||
431 | clean = False | ||
425 | setattr(self.configuration, o, options[o]) | 432 | setattr(self.configuration, o, options[o]) |
426 | for k in bb.utils.approved_variables(): | 433 | for k in bb.utils.approved_variables(): |
427 | if k in environment and k not in self.configuration.env: | 434 | if k in environment and k not in self.configuration.env: |
428 | logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k])) | 435 | logger.debug(1, "Updating new environment variable %s to %s" % (k, environment[k])) |
429 | self.configuration.env[k] = environment[k] | 436 | self.configuration.env[k] = environment[k] |
430 | clean = False | 437 | clean = False |
431 | if k in self.configuration.env and k not in environment: | 438 | if k in self.configuration.env and k not in environment: |
@@ -435,7 +442,7 @@ class BBCooker: | |||
435 | if k not in self.configuration.env and k not in environment: | 442 | if k not in self.configuration.env and k not in environment: |
436 | continue | 443 | continue |
437 | if environment[k] != self.configuration.env[k]: | 444 | if environment[k] != self.configuration.env[k]: |
438 | logger.debug(1, "Updating environment variable %s to %s" % (k, environment[k])) | 445 | logger.debug(1, "Updating environment variable %s from %s to %s" % (k, self.configuration.env[k], environment[k])) |
439 | self.configuration.env[k] = environment[k] | 446 | self.configuration.env[k] = environment[k] |
440 | clean = False | 447 | clean = False |
441 | if not clean: | 448 | if not clean: |