bitbake: cooker/hashserv: Allow autostarting of a local hash server using BB_HASHSERVE

Its useful, particularly in the local developer model of usage, for
bitbake to start and stop a hash equivalence server on local port,
rather than relying on one being started by the user before the build.

The new BB_HASHSERVE variable supports this.

The database handling is moved internally into the hashserv code so that
different threads/processes can be used for the server without errors.

(Bitbake rev: a4fa8f1bd88995ae60e10430316fbed63d478587)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2019-07-24 09:13:55 +01:00
parent d9aafb8507
commit ca04aaf7b5
6 changed files with 37 additions and 10 deletions

View File

@@ -41,9 +41,7 @@ def main():
console.setLevel(level)
logger.addHandler(console)
db = sqlite3.connect(args.database)
server = hashserv.create_server((args.address, args.port), db, args.prefix)
server = hashserv.create_server((args.address, args.port), args.database, args.prefix)
server.serve_forever()
return 0

View File

@@ -418,6 +418,7 @@ class BitbakeWorker(object):
bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"]
for mc in self.databuilder.mcdata:
self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"])
self.databuilder.mcdata[mc].setVar("BB_HASHSERVE", self.workerdata["hashservport"])
def handle_newtaskhashes(self, data):
self.workerdata["newhashes"] = pickle.loads(data)