summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-03 18:03:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-06 23:54:39 +0000
commit4cb1b4b409c4067c669fedef4a02be27689e3d26 (patch)
tree9135b86ff641ae20763fda2a523b727cd12a8a59
parentfd8d01134aaacb62ce344393fa2f3950c00ef6fc (diff)
downloadpoky-4cb1b4b409c4067c669fedef4a02be27689e3d26.tar.gz
sstate: Add extra directory level
We're having speed issues on the autobuilder due to the numbers of files in sstate directories. We previously split these by the first two characters of the hash. This change extends this to split by the next two characters as well, creating more layers of directories. This should signifiantly speed up eSDK builds on the autobuilder as the current sstate layout simply isn't scaling there but addresses a general complaint. gen-lockedsig-cache needed to be updated for the new split level sstate. Also update tests for new layout. (From OE-Core rev: d05bde16bdad761ed8f4c0a48de60c649aa33e85) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass4
-rw-r--r--meta/lib/oeqa/selftest/cases/signing.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/sstate.py4
-rwxr-xr-xscripts/gen-lockedsig-cache13
4 files changed, 16 insertions, 9 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index c0329cd5d1..7d2cb9eb84 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -6,7 +6,7 @@ SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
6def generate_sstatefn(spec, hash, d): 6def generate_sstatefn(spec, hash, d):
7 if not hash: 7 if not hash:
8 hash = "INVALID" 8 hash = "INVALID"
9 return hash[:2] + "/" + spec + hash 9 return hash[:2] + "/" + hash[2:4] + "/" + spec + hash
10 10
11SSTATE_PKGARCH = "${PACKAGE_ARCH}" 11SSTATE_PKGARCH = "${PACKAGE_ARCH}"
12SSTATE_PKGSPEC = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:" 12SSTATE_PKGSPEC = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
@@ -15,7 +15,7 @@ SSTATE_PKGNAME = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PK
15SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" 15SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
16SSTATE_EXTRAPATH = "" 16SSTATE_EXTRAPATH = ""
17SSTATE_EXTRAPATHWILDCARD = "" 17SSTATE_EXTRAPATHWILDCARD = ""
18SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}" 18SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/*/${SSTATE_PKGSPEC}"
19 19
20# explicitly make PV to depend on evaluated value of PV variable 20# explicitly make PV to depend on evaluated value of PV variable
21PV[vardepvalue] = "${PV}" 21PV[vardepvalue] = "${PV}"
diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
index 93b15ae681..202d54994b 100644
--- a/meta/lib/oeqa/selftest/cases/signing.py
+++ b/meta/lib/oeqa/selftest/cases/signing.py
@@ -157,8 +157,8 @@ class Signing(OESelftestTestCase):
157 bitbake('-c clean %s' % test_recipe) 157 bitbake('-c clean %s' % test_recipe)
158 bitbake('-c populate_lic %s' % test_recipe) 158 bitbake('-c populate_lic %s' % test_recipe)
159 159
160 recipe_sig = glob.glob(sstatedir + '/*/*:ed:*_populate_lic.tgz.sig') 160 recipe_sig = glob.glob(sstatedir + '/*/*/*:ed:*_populate_lic.tgz.sig')
161 recipe_tgz = glob.glob(sstatedir + '/*/*:ed:*_populate_lic.tgz') 161 recipe_tgz = glob.glob(sstatedir + '/*/*/*:ed:*_populate_lic.tgz')
162 162
163 self.assertEqual(len(recipe_sig), 1, 'Failed to find .sig file.') 163 self.assertEqual(len(recipe_sig), 1, 'Failed to find .sig file.')
164 self.assertEqual(len(recipe_tgz), 1, 'Failed to find .tgz file.') 164 self.assertEqual(len(recipe_tgz), 1, 'Failed to find .tgz file.')
diff --git a/meta/lib/oeqa/selftest/cases/sstate.py b/meta/lib/oeqa/selftest/cases/sstate.py
index 410dec64fc..80ce9e353c 100644
--- a/meta/lib/oeqa/selftest/cases/sstate.py
+++ b/meta/lib/oeqa/selftest/cases/sstate.py
@@ -56,11 +56,11 @@ class SStateBase(OESelftestTestCase):
56 def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True): 56 def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
57 result = [] 57 result = []
58 for root, dirs, files in os.walk(self.sstate_path): 58 for root, dirs, files in os.walk(self.sstate_path):
59 if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.hostdistro, root): 59 if distro_specific and re.search(r"%s/%s/[a-z0-9]{2}/[a-z0-9]{2}$" % (self.sstate_path, self.hostdistro), root):
60 for f in files: 60 for f in files:
61 if re.search(filename_regex, f): 61 if re.search(filename_regex, f):
62 result.append(f) 62 result.append(f)
63 if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root): 63 if distro_nonspecific and re.search(r"%s/[a-z0-9]{2}/[a-z0-9]{2}$" % self.sstate_path, root):
64 for f in files: 64 for f in files:
65 if re.search(filename_regex, f): 65 if re.search(filename_regex, f):
66 result.append(f) 66 result.append(f)
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 9bfae9d832..6a7d285910 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -78,11 +78,18 @@ files = set()
78sstate_content_cache = {} 78sstate_content_cache = {}
79for s in sigs: 79for s in sigs:
80 prefix = s[:2] 80 prefix = s[:2]
81 prefix2 = s[2:4]
81 if prefix not in sstate_content_cache: 82 if prefix not in sstate_content_cache:
82 sstate_content_cache[prefix] = build_sha_cache(prefix) 83 sstate_content_cache[prefix] = build_sha_cache(prefix)
83 84 if prefix2 not in sstate_content_cache[prefix]:
84 for f in sstate_content_cache[prefix][s]: 85 sstate_content_cache[prefix][prefix2] = build_sha_cache(prefix + "/" + prefix2)
85 files.add(f) 86
87 if s in sstate_content_cache[prefix]:
88 for f in sstate_content_cache[prefix][s]:
89 files.add(f)
90 if s in sstate_content_cache[prefix][prefix2]:
91 for f in sstate_content_cache[prefix][prefix2][s]:
92 files.add(f)
86 93
87elapsed = time.perf_counter() - start_time 94elapsed = time.perf_counter() - start_time
88print("Gathering file list took %.1fs" % elapsed) 95print("Gathering file list took %.1fs" % elapsed)