summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-31 17:09:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-31 23:30:03 +0100
commit2e41f733fafc708149c03ace75d325580925fd88 (patch)
tree857ec3e0e71ff3a448b526211c3f79af1d36030a /bitbake
parentfc2f9c8a6370c4fa97bf74f7fa37704d717afa03 (diff)
downloadpoky-2e41f733fafc708149c03ace75d325580925fd88.tar.gz
bitbake: cooker: Allow changes in PRSERV_HOST to be responded to
When we reload the configuration, PRSERV_HOST can change. Therefore restart the PR Server depending on the new configuration at reparse. Note that the server has to be started from the right process, it can't be in the UI which shuts down as that shutdown triggers a shutdown of its children and the PR Server shuts down too. This is why we need pre_serve() which ensures its executed in the right context. (Bitbake rev: 971272e84f4efe7ebd0037e164ba54f013a2a34e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 5ee1c0ac85..a2c1b40203 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -379,6 +379,13 @@ class BBCooker:
379 self.baseconfig_valid = True 379 self.baseconfig_valid = True
380 self.parsecache_valid = False 380 self.parsecache_valid = False
381 381
382 def handlePRServ(self):
383 # Setup a PR Server based on the new configuration
384 try:
385 self.prhost = prserv.serv.auto_start(self.data)
386 except prserv.serv.PRServiceConfigError as e:
387 bb.fatal("Unable to start PR Server, exitting")
388
382 def enableDataTracking(self): 389 def enableDataTracking(self):
383 self.configuration.tracking = True 390 self.configuration.tracking = True
384 if hasattr(self, "data"): 391 if hasattr(self, "data"):
@@ -1468,6 +1475,7 @@ class BBCooker:
1468 if not self.baseconfig_valid: 1475 if not self.baseconfig_valid:
1469 logger.debug(1, "Reloading base configuration data") 1476 logger.debug(1, "Reloading base configuration data")
1470 self.initConfigurationData() 1477 self.initConfigurationData()
1478 self.handlePRServ()
1471 1479
1472 # This is called for all async commands when self.state != running 1480 # This is called for all async commands when self.state != running
1473 def updateCache(self): 1481 def updateCache(self):
@@ -1571,14 +1579,9 @@ class BBCooker:
1571 return pkgs_to_build 1579 return pkgs_to_build
1572 1580
1573 def pre_serve(self): 1581 def pre_serve(self):
1574 # Empty the environment. The environment will be populated as 1582 # We now are in our own process so we can call this here.
1575 # necessary from the data store. 1583 # PRServ exits if its parent process exits
1576 #bb.utils.empty_environment() 1584 self.handlePRServ()
1577 try:
1578 self.prhost = prserv.serv.auto_start(self.data)
1579 except prserv.serv.PRServiceConfigError:
1580 bb.event.fire(CookerExit(), self.data)
1581 self.state = state.error
1582 return 1585 return
1583 1586
1584 def post_serve(self): 1587 def post_serve(self):