diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 17:07:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-31 23:30:03 +0100 |
commit | 984da85479fa6127df806b2aa3a9fb27d268f2a3 (patch) | |
tree | 0df2e12928642236be1492f96dd8fccfa88622da | |
parent | 5759039a89674c1e11b3d73cd6487f4586d25a73 (diff) | |
download | poky-984da85479fa6127df806b2aa3a9fb27d268f2a3.tar.gz |
bitbake: cooker: Change to consistent prefile/postfile handling
Currently the original prefile and postfile passed when starting bitbake
server are 'sticky'. With the new memory resident model this doesn't make
sense as the server the system is started with isn't special.
This patch changes the code so the prefile/postfile are used if specified
on the commandline and not used otherwise. This makes the behaviour much
more predictable and expected and as an added bonus simplifies the code.
(Bitbake rev: 638d366234fad78f283d3a13a12b07cb0ccbe914)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cooker.py | 23 | ||||
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/server/process.py | 6 |
3 files changed, 10 insertions, 21 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index ad08c473ae..5ee1c0ac85 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -416,19 +416,16 @@ class BBCooker: | |||
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']: |
419 | server_val = getattr(self.configuration, "%s_server" % o, None) | 419 | # Only these options may require a reparse |
420 | if not options[o] and server_val: | 420 | try: |
421 | # restore value provided on server start | 421 | if getattr(self.configuration, o) == options[o]: |
422 | logger.debug(1, "Restoring server value for option '%s'" % o) | 422 | # Value is the same, no need to mark dirty |
423 | setattr(self.configuration, o, server_val) | 423 | continue |
424 | clean = False | 424 | except AttributeError: |
425 | continue | 425 | pass |
426 | if getattr(self.configuration, o) == options[o]: | 426 | logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) |
427 | # Value is the same, no need to mark dirty | 427 | print("Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) |
428 | continue | 428 | clean = False |
429 | else: | ||
430 | logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o])) | ||
431 | clean = False | ||
432 | setattr(self.configuration, o, options[o]) | 429 | setattr(self.configuration, o, options[o]) |
433 | for k in bb.utils.approved_variables(): | 430 | for k in bb.utils.approved_variables(): |
434 | if k in environment and k not in self.configuration.env: | 431 | if k in environment and k not in self.configuration.env: |
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 197db6215e..d105ab7b2d 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -127,8 +127,6 @@ class CookerConfiguration(object): | |||
127 | self.extra_assume_provided = [] | 127 | self.extra_assume_provided = [] |
128 | self.prefile = [] | 128 | self.prefile = [] |
129 | self.postfile = [] | 129 | self.postfile = [] |
130 | self.prefile_server = [] | ||
131 | self.postfile_server = [] | ||
132 | self.debug = 0 | 130 | self.debug = 0 |
133 | self.cmd = None | 131 | self.cmd = None |
134 | self.abort = True | 132 | self.abort = True |
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index fad8aac4da..5c7dfaefa1 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -405,12 +405,6 @@ class BitBakeServer(object): | |||
405 | server = ProcessServer(self.bitbake_lock, self.sock, self.sockname) | 405 | server = ProcessServer(self.bitbake_lock, self.sock, self.sockname) |
406 | self.configuration.setServerRegIdleCallback(server.register_idle_function) | 406 | self.configuration.setServerRegIdleCallback(server.register_idle_function) |
407 | 407 | ||
408 | # Copy prefile and postfile to _server variants | ||
409 | for param in ('prefile', 'postfile'): | ||
410 | value = getattr(self.configuration, param) | ||
411 | if value: | ||
412 | setattr(self.configuration, "%s_server" % param, value) | ||
413 | |||
414 | self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, self.readypipein) | 408 | self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, self.readypipein) |
415 | server.cooker = self.cooker | 409 | server.cooker = self.cooker |
416 | server.server_timeout = self.configuration.server_timeout | 410 | server.server_timeout = self.configuration.server_timeout |