diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-03 18:03:35 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-06 23:54:39 +0000 |
commit | 4cb1b4b409c4067c669fedef4a02be27689e3d26 (patch) | |
tree | 9135b86ff641ae20763fda2a523b727cd12a8a59 | |
parent | fd8d01134aaacb62ce344393fa2f3950c00ef6fc (diff) | |
download | poky-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.bbclass | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/signing.py | 4 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstate.py | 4 | ||||
-rwxr-xr-x | scripts/gen-lockedsig-cache | 13 |
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}" | |||
6 | def generate_sstatefn(spec, hash, d): | 6 | def 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 | ||
11 | SSTATE_PKGARCH = "${PACKAGE_ARCH}" | 11 | SSTATE_PKGARCH = "${PACKAGE_ARCH}" |
12 | SSTATE_PKGSPEC = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:" | 12 | SSTATE_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 | |||
15 | SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" | 15 | SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" |
16 | SSTATE_EXTRAPATH = "" | 16 | SSTATE_EXTRAPATH = "" |
17 | SSTATE_EXTRAPATHWILDCARD = "" | 17 | SSTATE_EXTRAPATHWILDCARD = "" |
18 | SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}" | 18 | SSTATE_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 |
21 | PV[vardepvalue] = "${PV}" | 21 | PV[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() | |||
78 | sstate_content_cache = {} | 78 | sstate_content_cache = {} |
79 | for s in sigs: | 79 | for 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 | ||
87 | elapsed = time.perf_counter() - start_time | 94 | elapsed = time.perf_counter() - start_time |
88 | print("Gathering file list took %.1fs" % elapsed) | 95 | print("Gathering file list took %.1fs" % elapsed) |