diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-12 16:53:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-12 21:41:15 +0100 |
commit | e56c49717355c9493b07d5fc80981a95ad8a0ec8 (patch) | |
tree | 182c2ab3fe43bf4eb2db193c9361b345ecf30151 | |
parent | d214e55c45f9733b3289138feec0ae3361a4a48b (diff) | |
download | bitbake-e56c49717355c9493b07d5fc80981a95ad8a0ec8.tar.gz |
server/process: Simplfy idle callback handler function
Having the idle callbacks abstracted via the configuration object
makes no sense. Its like this for historical reasons from the
multiple server backends but we don't need this now so simplfy.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/command.py | 2 | ||||
-rw-r--r-- | lib/bb/cooker.py | 10 | ||||
-rw-r--r-- | lib/bb/cookerdata.py | 8 | ||||
-rw-r--r-- | lib/bb/server/process.py | 3 |
4 files changed, 9 insertions, 14 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py index 48a7f1a15..4d152ff4c 100644 --- a/lib/bb/command.py +++ b/lib/bb/command.py @@ -84,7 +84,7 @@ class Command: if command not in CommandsAsync.__dict__: return None, "No such command" self.currentAsyncCommand = (command, commandline) - self.cooker.configuration.server_register_idlecallback(self.cooker.runCommands, self.cooker) + self.cooker.idleCallBackRegister(self.cooker.runCommands, self.cooker) return True, None def runAsyncCommand(self): diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index f6abc6348..912360546 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -148,7 +148,7 @@ class BBCooker: Manages one bitbake build run """ - def __init__(self, configuration, featureSet=None): + def __init__(self, configuration, featureSet=None, idleCallBackRegister=None): self.recipecaches = None self.skiplist = {} self.featureset = CookerFeatures() @@ -158,6 +158,8 @@ class BBCooker: self.configuration = configuration + self.idleCallBackRegister = idleCallBackRegister + bb.debug(1, "BBCooker starting %s" % time.time()) sys.stdout.flush() @@ -210,7 +212,7 @@ class BBCooker: cooker.process_inotify_updates() return 1.0 - self.configuration.server_register_idlecallback(_process_inotify_updates, self) + self.idleCallBackRegister(_process_inotify_updates, self) # TOSTOP must not be set or our children will hang when they output try: @@ -1423,7 +1425,7 @@ class BBCooker: return True return retval - self.configuration.server_register_idlecallback(buildFileIdle, rq) + self.idleCallBackRegister(buildFileIdle, rq) def buildTargets(self, targets, task): """ @@ -1494,7 +1496,7 @@ class BBCooker: if 'universe' in targets: rq.rqdata.warn_multi_bb = True - self.configuration.server_register_idlecallback(buildTargetsIdle, rq) + self.idleCallBackRegister(buildTargetsIdle, rq) def getAllKeysWithFlags(self, flaglist): diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py index 24bf09c56..b86e7d446 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -143,16 +143,10 @@ class CookerConfiguration(object): setattr(self, key, parameters.options.__dict__[key]) self.env = parameters.environment.copy() - def setServerRegIdleCallback(self, srcb): - self.server_register_idlecallback = srcb - def __getstate__(self): state = {} for key in self.__dict__.keys(): - if key == "server_register_idlecallback": - state[key] = None - else: - state[key] = getattr(self, key) + state[key] = getattr(self, key) return state def __setstate__(self,state): diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index a152b4482..a3ef10753 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -467,11 +467,10 @@ class BitBakeServer(object): sys.stdout.flush() server = ProcessServer(self.bitbake_lock, self.sock, self.sockname) - self.configuration.setServerRegIdleCallback(server.register_idle_function) os.close(self.readypipe) writer = ConnectionWriter(self.readypipein) try: - self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset) + self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, server.register_idle_function) except bb.BBHandledException: return None writer.send("r") |