mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
fd8d01134a
commit
4cb1b4b409
|
@ -6,7 +6,7 @@ SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
|
|||
def generate_sstatefn(spec, hash, d):
|
||||
if not hash:
|
||||
hash = "INVALID"
|
||||
return hash[:2] + "/" + spec + hash
|
||||
return hash[:2] + "/" + hash[2:4] + "/" + spec + hash
|
||||
|
||||
SSTATE_PKGARCH = "${PACKAGE_ARCH}"
|
||||
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
|
|||
SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
|
||||
SSTATE_EXTRAPATH = ""
|
||||
SSTATE_EXTRAPATHWILDCARD = ""
|
||||
SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
|
||||
SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/*/${SSTATE_PKGSPEC}"
|
||||
|
||||
# explicitly make PV to depend on evaluated value of PV variable
|
||||
PV[vardepvalue] = "${PV}"
|
||||
|
|
|
@ -157,8 +157,8 @@ class Signing(OESelftestTestCase):
|
|||
bitbake('-c clean %s' % test_recipe)
|
||||
bitbake('-c populate_lic %s' % test_recipe)
|
||||
|
||||
recipe_sig = glob.glob(sstatedir + '/*/*:ed:*_populate_lic.tgz.sig')
|
||||
recipe_tgz = glob.glob(sstatedir + '/*/*:ed:*_populate_lic.tgz')
|
||||
recipe_sig = glob.glob(sstatedir + '/*/*/*:ed:*_populate_lic.tgz.sig')
|
||||
recipe_tgz = glob.glob(sstatedir + '/*/*/*:ed:*_populate_lic.tgz')
|
||||
|
||||
self.assertEqual(len(recipe_sig), 1, 'Failed to find .sig file.')
|
||||
self.assertEqual(len(recipe_tgz), 1, 'Failed to find .tgz file.')
|
||||
|
|
|
@ -56,11 +56,11 @@ class SStateBase(OESelftestTestCase):
|
|||
def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
|
||||
result = []
|
||||
for root, dirs, files in os.walk(self.sstate_path):
|
||||
if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.hostdistro, root):
|
||||
if distro_specific and re.search(r"%s/%s/[a-z0-9]{2}/[a-z0-9]{2}$" % (self.sstate_path, self.hostdistro), root):
|
||||
for f in files:
|
||||
if re.search(filename_regex, f):
|
||||
result.append(f)
|
||||
if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root):
|
||||
if distro_nonspecific and re.search(r"%s/[a-z0-9]{2}/[a-z0-9]{2}$" % self.sstate_path, root):
|
||||
for f in files:
|
||||
if re.search(filename_regex, f):
|
||||
result.append(f)
|
||||
|
|
|
@ -78,11 +78,18 @@ files = set()
|
|||
sstate_content_cache = {}
|
||||
for s in sigs:
|
||||
prefix = s[:2]
|
||||
prefix2 = s[2:4]
|
||||
if prefix not in sstate_content_cache:
|
||||
sstate_content_cache[prefix] = build_sha_cache(prefix)
|
||||
if prefix2 not in sstate_content_cache[prefix]:
|
||||
sstate_content_cache[prefix][prefix2] = build_sha_cache(prefix + "/" + prefix2)
|
||||
|
||||
for f in sstate_content_cache[prefix][s]:
|
||||
files.add(f)
|
||||
if s in sstate_content_cache[prefix]:
|
||||
for f in sstate_content_cache[prefix][s]:
|
||||
files.add(f)
|
||||
if s in sstate_content_cache[prefix][prefix2]:
|
||||
for f in sstate_content_cache[prefix][prefix2][s]:
|
||||
files.add(f)
|
||||
|
||||
elapsed = time.perf_counter() - start_time
|
||||
print("Gathering file list took %.1fs" % elapsed)
|
||||
|
|
Loading…
Reference in New Issue
Block a user