summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-24 14:57:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-25 18:14:53 +0100
commit0bcc00ac517bdb9a8035397fcac0a402fe1aad13 (patch)
treed4aa8bd9e8660e1e7bb5ac752523237f9b7d5e44 /bitbake/lib/bb/cooker.py
parent59421f688ce5a6ca95e7a02bb4e517b4690cad8c (diff)
downloadpoky-0bcc00ac517bdb9a8035397fcac0a402fe1aad13.tar.gz
bitbake: cooker: Defer configuration init to after UI connection
Currently we end up parsing the base configuration multiple times as initially, the right settings haven't come from the UI. We can defer this until later in startup using runCommand as a trigger. The advantage to doing this is improved startup times and ultimately we should be able to avoid the double parse of the base configuration. (Bitbake rev: 3caa43b665604475d2c87ba505efb0b9fca9c2e9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 3f351cbea6..3f9cb75434 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -195,11 +195,6 @@ class BBCooker:
195 self.hashserv = None 195 self.hashserv = None
196 self.hashservaddr = None 196 self.hashservaddr = None
197 197
198 self.initConfigurationData()
199
200 bb.debug(1, "BBCooker parsed base configuration %s" % time.time())
201 sys.stdout.flush()
202
203 self.inotify_modified_files = [] 198 self.inotify_modified_files = []
204 199
205 def _process_inotify_updates(server, cooker, abort): 200 def _process_inotify_updates(server, cooker, abort):
@@ -233,6 +228,13 @@ class BBCooker:
233 bb.debug(1, "BBCooker startup complete %s" % time.time()) 228 bb.debug(1, "BBCooker startup complete %s" % time.time())
234 sys.stdout.flush() 229 sys.stdout.flush()
235 230
231 def init_configdata(self):
232 if not hasattr(self, "data"):
233 self.initConfigurationData()
234 bb.debug(1, "BBCooker parsed base configuration %s" % time.time())
235 sys.stdout.flush()
236 self.handlePRServ()
237
236 def process_inotify_updates(self): 238 def process_inotify_updates(self):
237 for n in [self.confignotifier, self.notifier]: 239 for n in [self.confignotifier, self.notifier]:
238 if n.check_events(timeout=0): 240 if n.check_events(timeout=0):
@@ -318,7 +320,7 @@ class BBCooker:
318 for feature in features: 320 for feature in features:
319 self.featureset.setFeature(feature) 321 self.featureset.setFeature(feature)
320 bb.debug(1, "Features set %s (was %s)" % (original_featureset, list(self.featureset))) 322 bb.debug(1, "Features set %s (was %s)" % (original_featureset, list(self.featureset)))
321 if (original_featureset != list(self.featureset)) and self.state != state.error: 323 if (original_featureset != list(self.featureset)) and self.state != state.error and hasattr(self, "data"):
322 self.reset() 324 self.reset()
323 325
324 def initConfigurationData(self): 326 def initConfigurationData(self):
@@ -1658,9 +1660,6 @@ class BBCooker:
1658 return pkgs_to_build 1660 return pkgs_to_build
1659 1661
1660 def pre_serve(self): 1662 def pre_serve(self):
1661 # We now are in our own process so we can call this here.
1662 # PRServ exits if its parent process exits
1663 self.handlePRServ()
1664 return 1663 return
1665 1664
1666 def post_serve(self): 1665 def post_serve(self):