summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-11-04 19:28:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-05 11:41:46 +0000
commit45f732273c1ad14a534695ea197c923a5c971217 (patch)
tree7b76f93f1cc6c41479374f42191005dfaff8320f /bitbake
parent47e5c456a20432b511d830df9cbd4113a4352b2c (diff)
downloadpoky-45f732273c1ad14a534695ea197c923a5c971217.tar.gz
bitbake: cooker: check if upstream hash equivalence server is available
When the user specify an invalid upstream hash equivalence server in BB_HASHSERVE_UPSTREAM notify the user that we can't connect the server. (Bitbake rev: be45aeb9a84f30c28711e87e2d2a4a86320a8d94) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 194595ce8b..2b92744998 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -388,12 +388,22 @@ class BBCooker:
388 # Create a new hash server bound to a unix domain socket 388 # Create a new hash server bound to a unix domain socket
389 if not self.hashserv: 389 if not self.hashserv:
390 dbfile = (self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")) + "/hashserv.db" 390 dbfile = (self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")) + "/hashserv.db"
391 upstream = self.data.getVar("BB_HASHSERVE_UPSTREAM") or None
392 if upstream:
393 import socket
394 try:
395 sock = socket.create_connection(upstream.split(":"), 5)
396 sock.close()
397 except socket.error as e:
398 bb.warn("BB_HASHSERVE_UPSTREAM is not valid, unable to connect hash equivalence server at '%s': %s"
399 % (upstream, repr(e)))
400
391 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR") 401 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
392 self.hashserv = hashserv.create_server( 402 self.hashserv = hashserv.create_server(
393 self.hashservaddr, 403 self.hashservaddr,
394 dbfile, 404 dbfile,
395 sync=False, 405 sync=False,
396 upstream=self.data.getVar("BB_HASHSERVE_UPSTREAM") or None, 406 upstream=upstream,
397 ) 407 )
398 self.hashserv.serve_as_process() 408 self.hashserv.serve_as_process()
399 self.data.setVar("BB_HASHSERVE", self.hashservaddr) 409 self.data.setVar("BB_HASHSERVE", self.hashservaddr)