@@ -312,21 +312,25 @@ class BBCooker:
# Create a new hash server bound to a unix domain socket
if not self.hashserv:
dbfile = (self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")) + "/hashserv.db"
- upstream = self.data.getVar("BB_HASHSERVE_UPSTREAM") or None
- if upstream:
- try:
- with hashserv.create_client(upstream) as client:
- client.ping()
- except ImportError as e:
- bb.fatal(""""Unable to use hash equivalence server at '%s' due to missing or incorrect python module:
-%s
-Please install the needed module on the build host, or use an environment containing it (e.g a pip venv or OpenEmbedded's buildtools tarball).
-You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in significantly longer build times as bitbake will be unable to reuse prebuilt sstate artefacts."""
- % (upstream, repr(e)))
- except ConnectionError as e:
- bb.warn("Unable to connect to hash equivalence server at '%s', please correct or remove BB_HASHSERVE_UPSTREAM:\n%s"
- % (upstream, repr(e)))
- upstream = None
+ hashserve_upstream_list = self.data.getVar("BB_HASHSERVE_UPSTREAM") or None
+ upstream = None
+ if hashserve_upstream_list:
+ for hashserve_upstream in hashserve_upstream_list.split():
+ try:
+ with hashserv.create_client(hashserve_upstream) as client:
+ client.ping()
+ upstream = hashserve_upstream
+ break
+ except ImportError as e:
+ bb.warn("Unable to connect to hash equivalence server at '%s' due to missing or incorrect python module:\n%s"
+ % (hashserve_upstream, repr(e)))
+ except ConnectionError as e:
+ bb.warn("Unable to connect to hash equivalence server at '%s':\n%s"
+ % (hashserve_upstream, repr(e)))
+
+ if hashserve_upstream_list and not upstream:
+ bb.fatal("""Unable to use hash equivalence server:
+ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in significantly longer build times as bitbake will be unable to reuse prebuilt sstate artefacts.""")
self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
self.hashserv = hashserv.create_server(