@@ -336,6 +336,25 @@ cannot be on a NFS mount due to potential NFS locking issues between sqlite clie
If you need to share the database between several computers, set up a permanently running hash equivalency server
according to https://docs.yoctoproject.org/dev-manual/hashequivserver.html""".format(bb_hashserve_db_dir))
dbdir = bb_hashserve_db_dir or self.data.getVar("PERSISTENT_DIR") or self.data.getVar("CACHE")
+
+ topdir = self.data.getVar("TOPDIR")
+ sstatedir = self.data.getVar("SSTATE_DIR")
+ if (dbdir and topdir and sstatedir and dbdir.startswith(topdir) and not sstatedir.startswith(topdir)):
+ if utils.is_path_on_nfs(sstatedir):
+ bb.warn("""Sstate directory is on a shared NFS (it is set via SSTATE_DIR to {}),
+but hash equivalency database is inside this particular build directory {}.
+
+This will prevent sstate reuse, and it is recommended to set up a permanently running hash equivalency server
+according to https://docs.yoctoproject.org/dev-manual/hashequivserver.html""".format(sstatedir, topdir))
+ else:
+ bb.warn("""Sstate directory is shared between several builds (it is set via SSTATE_DIR to {}),
+but hash equivalency database is inside this particular build directory {}.
+
+This will prevent sstate reuse, and it is recommended to set the location for the database to a common path
+via BB_HASHSERVE_DB_DIR, for example:
+
+BB_HASHSERVE_DB_DIR = \"${{SSTATE_DIR}}\"""".format(sstatedir, topdir))
+
os.makedirs(dbdir, exist_ok=True)
dbfile = dbdir + "/hashserv.db"
upstream = self.data.getVar("BB_HASHSERVE_UPSTREAM") or None