summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/cooker.py29
-rw-r--r--bitbake/lib/hashserv/__init__.py1
2 files changed, 18 insertions, 12 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index ec1b35d724..0607fcc708 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -371,22 +371,10 @@ class BBCooker:
371 371
372 self.data.setVar('BB_CMDLINE', self.ui_cmdline) 372 self.data.setVar('BB_CMDLINE', self.ui_cmdline)
373 373
374 if self.data.getVar("BB_HASHSERVE") == "localhost:0":
375 if not self.hashserv:
376 dbfile = (self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")) + "/hashserv.db"
377 self.hashserv = hashserv.create_server(('localhost', 0), dbfile, '')
378 self.hashservport = "localhost:" + str(self.hashserv.server_port)
379 self.hashserv.process = multiprocessing.Process(target=self.hashserv.serve_forever)
380 self.hashserv.process.daemon = True
381 self.hashserv.process.start()
382 self.data.setVar("BB_HASHSERVE", self.hashservport)
383
384 # 374 #
385 # Copy of the data store which has been expanded. 375 # Copy of the data store which has been expanded.
386 # Used for firing events and accessing variables where expansion needs to be accounted for 376 # Used for firing events and accessing variables where expansion needs to be accounted for
387 # 377 #
388 bb.parse.init_parser(self.data)
389
390 if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset: 378 if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
391 self.disableDataTracking() 379 self.disableDataTracking()
392 380
@@ -404,6 +392,22 @@ class BBCooker:
404 except prserv.serv.PRServiceConfigError as e: 392 except prserv.serv.PRServiceConfigError as e:
405 bb.fatal("Unable to start PR Server, exitting") 393 bb.fatal("Unable to start PR Server, exitting")
406 394
395 if self.data.getVar("BB_HASHSERVE") == "localhost:0":
396 if not self.hashserv:
397 dbfile = (self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")) + "/hashserv.db"
398 self.hashserv = hashserv.create_server(('localhost', 0), dbfile, '')
399 self.hashservport = "localhost:" + str(self.hashserv.server_port)
400 self.hashserv.process = multiprocessing.Process(target=self.hashserv.serve_forever)
401 self.hashserv.process.daemon = True
402 self.hashserv.process.start()
403 self.data.setVar("BB_HASHSERVE", self.hashservport)
404 self.databuilder.origdata.setVar("BB_HASHSERVE", self.hashservport)
405 self.databuilder.data.setVar("BB_HASHSERVE", self.hashservport)
406 for mc in self.databuilder.mcdata:
407 self.databuilder.mcdata[mc].setVar("BB_HASHSERVE", self.hashservport)
408
409 bb.parse.init_parser(self.data)
410
407 def enableDataTracking(self): 411 def enableDataTracking(self):
408 self.configuration.tracking = True 412 self.configuration.tracking = True
409 if hasattr(self, "data"): 413 if hasattr(self, "data"):
@@ -1677,6 +1681,7 @@ class BBCooker:
1677 1681
1678 def reset(self): 1682 def reset(self):
1679 self.initConfigurationData() 1683 self.initConfigurationData()
1684 self.handlePRServ()
1680 1685
1681 def clientComplete(self): 1686 def clientComplete(self):
1682 """Called when the client is done using the server""" 1687 """Called when the client is done using the server"""
diff --git a/bitbake/lib/hashserv/__init__.py b/bitbake/lib/hashserv/__init__.py
index 1d5e08ee5a..55966e748a 100644
--- a/bitbake/lib/hashserv/__init__.py
+++ b/bitbake/lib/hashserv/__init__.py
@@ -151,6 +151,7 @@ class ThreadedHTTPServer(HTTPServer):
151 151
152 signal.signal(signal.SIGTERM, self.sigterm_exception) 152 signal.signal(signal.SIGTERM, self.sigterm_exception)
153 super().serve_forever() 153 super().serve_forever()
154 os._exit(0)
154 155
155 def sigterm_exception(self, signum, stackframe): 156 def sigterm_exception(self, signum, stackframe):
156 self.server_close() 157 self.server_close()