All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] sstate: Add extra directory level
@ 2020-01-06  0:06 Richard Purdie
  2020-01-06  0:06 ` [PATCH 2/4] sstate: Improve SSTATE_PKG handling Richard Purdie
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Richard Purdie @ 2020-01-06  0:06 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/sstate.bbclass             |  4 ++--
 meta/lib/oeqa/selftest/cases/signing.py |  4 ++--
 meta/lib/oeqa/selftest/cases/sstate.py  |  4 ++--
 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 c0329cd5d18..7d2cb9eb840 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -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}"
diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
index b65f3de64c4..9ea31328eff 100644
--- a/meta/lib/oeqa/selftest/cases/signing.py
+++ b/meta/lib/oeqa/selftest/cases/signing.py
@@ -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.')
diff --git a/meta/lib/oeqa/selftest/cases/sstate.py b/meta/lib/oeqa/selftest/cases/sstate.py
index 410dec64fcd..80ce9e353c0 100644
--- a/meta/lib/oeqa/selftest/cases/sstate.py
+++ b/meta/lib/oeqa/selftest/cases/sstate.py
@@ -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)
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 9bfae9d8323..6a7d2859104 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -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)
-
-    for f in sstate_content_cache[prefix][s]:
-        files.add(f)
+    if prefix2 not in sstate_content_cache[prefix]:
+        sstate_content_cache[prefix][prefix2] = build_sha_cache(prefix + "/" + prefix2)
+
+    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)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] sstate: Improve SSTATE_PKG handling
  2020-01-06  0:06 [PATCH 1/4] sstate: Add extra directory level Richard Purdie
@ 2020-01-06  0:06 ` Richard Purdie
  2020-01-06  0:06 ` [PATCH 3/4] sstate: Merge file name generation into single function Richard Purdie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2020-01-06  0:06 UTC (permalink / raw)
  To: openembedded-core

Move the task handling code into the SSTATE_PKGNAME variable using a temporary variable.

This makes the code more understandable as as well as allowing the length of the
final sstate filename to be more easily accesses for following patches.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 7d2cb9eb840..5bd4031e536 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -11,11 +11,11 @@ def generate_sstatefn(spec, hash, d):
 SSTATE_PKGARCH    = "${PACKAGE_ARCH}"
 SSTATE_PKGSPEC    = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
 SSTATE_SWSPEC     = "sstate:${PN}::${PV}:${PR}::${SSTATE_VERSION}:"
-SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_UNIHASH'), d)}"
+SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_UNIHASH'), d)}_${SSTATE_CURRTASK}.tgz"
 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}*_${SSTATE_PATH_CURRTASK}.tgz*"
 
 # explicitly make PV to depend on evaluated value of PV variable
 PV[vardepvalue] = "${PV}"
@@ -317,8 +317,8 @@ def sstate_installpkg(ss, d):
     from oe.gpg_sign import get_signer
 
     sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
-    sstatefetch = d.getVar('SSTATE_PKGNAME') + '_' + ss['task'] + ".tgz"
-    d.appendVar('SSTATE_PKG', '_'+ ss['task'] + ".tgz")
+    d.setVar("SSTATE_CURRTASK", ss['task'])
+    sstatefetch = d.getVar('SSTATE_PKGNAME')
     sstatepkg = d.getVar('SSTATE_PKG')
 
     if not os.path.exists(sstatepkg):
@@ -440,8 +440,9 @@ python sstate_hardcode_path_unpack () {
 def sstate_clean_cachefile(ss, d):
     import oe.path
 
-    sstatepkgfile = d.getVar('SSTATE_PATHSPEC') + "*_" + ss['task'] + ".tgz*"
     if d.getVarFlag('do_%s' % ss['task'], 'task'):
+        d.setVar("SSTATE_PATH_CURRTASK", ss['task'])
+        sstatepkgfile = d.getVar('SSTATE_PATHSPEC')
         bb.note("Removing %s" % sstatepkgfile)
         oe.path.remove(sstatepkgfile)
 
@@ -612,7 +613,7 @@ def sstate_package(ss, d):
     tmpdir = d.getVar('TMPDIR')
 
     sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
-    d.appendVar('SSTATE_PKG', '_'+ ss['task'] + ".tgz")
+    d.setVar("SSTATE_CURRTASK", ss['task'])
     bb.utils.remove(sstatebuild, recurse=True)
     bb.utils.mkdirhier(sstatebuild)
     for state in ss['dirs']:
@@ -1081,17 +1082,17 @@ addhandler sstate_eventhandler
 sstate_eventhandler[eventmask] = "bb.build.TaskSucceeded"
 python sstate_eventhandler() {
     d = e.data
-    # When we write an sstate package we rewrite the SSTATE_PKG
-    spkg = d.getVar('SSTATE_PKG')
-    if not spkg.endswith(".tgz"):
+    writtensstate = d.getVar('SSTATE_CURRTASK')
+    if not writtensstate:
         taskname = d.getVar("BB_RUNTASK")[3:]
         spec = d.getVar('SSTATE_PKGSPEC')
         swspec = d.getVar('SSTATE_SWSPEC')
         if taskname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and swspec:
             d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
             d.setVar("SSTATE_EXTRAPATH", "")
+        d.setVar("SSTATE_CURRTASK", taskname)
         sstatepkg = d.getVar('SSTATE_PKG')
-        bb.siggen.dump_this_task(sstatepkg + '_' + taskname + ".tgz" ".siginfo", d)
+        bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
 }
 
 SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] sstate: Merge file name generation into single function
  2020-01-06  0:06 [PATCH 1/4] sstate: Add extra directory level Richard Purdie
  2020-01-06  0:06 ` [PATCH 2/4] sstate: Improve SSTATE_PKG handling Richard Purdie
@ 2020-01-06  0:06 ` Richard Purdie
  2020-01-06  0:06 ` [PATCH 4/4] sstate: Handle sstate filenames longer than 255 characters Richard Purdie
  2020-01-06  0:41 ` [PATCH 1/4] sstate: Add extra directory level akuster808
  3 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2020-01-06  0:06 UTC (permalink / raw)
  To: openembedded-core

Move the task handling and extension handling into one common filename
construction function.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 5bd4031e536..71ae0900777 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -3,15 +3,20 @@ SSTATE_VERSION = "3"
 SSTATE_MANIFESTS ?= "${TMPDIR}/sstate-control"
 SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
 
-def generate_sstatefn(spec, hash, d):
+def generate_sstatefn(spec, hash, taskname, siginfo, d):
+    if taskname is None:
+       return ""
+    extension = ".tgz"
+    if siginfo:
+        extension = ".tgz.siginfo"
     if not hash:
         hash = "INVALID"
-    return hash[:2] + "/" + hash[2:4] + "/" + spec + hash
+    return hash[:2] + "/" + hash[2:4] + "/" + spec + hash + "_" + taskname + extension
 
 SSTATE_PKGARCH    = "${PACKAGE_ARCH}"
 SSTATE_PKGSPEC    = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
 SSTATE_SWSPEC     = "sstate:${PN}::${PV}:${PR}::${SSTATE_VERSION}:"
-SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_UNIHASH'), d)}_${SSTATE_CURRTASK}.tgz"
+SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_UNIHASH'), d.getVar('SSTATE_CURRTASK'), False, d)}"
 SSTATE_PKG        = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
 SSTATE_EXTRAPATH   = ""
 SSTATE_EXTRAPATHWILDCARD = ""
@@ -822,9 +827,6 @@ BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
 def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
     found = set()
     missed = set()
-    extension = ".tgz"
-    if siginfo:
-        extension = extension + ".siginfo"
 
     def gethash(task):
         return sq_data['unihash'][task]
@@ -851,7 +853,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
         spec, extrapath, tname = getpathcomponents(tid, d)
 
-        sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, gethash(tid), d) + "_" + tname + extension)
+        sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
 
         if os.path.exists(sstatefile):
             bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
@@ -914,7 +916,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
             if tid in found:
                 continue
             spec, extrapath, tname = getpathcomponents(tid, d)
-            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), d) + "_" + tname + extension)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
             tasklist.append((tid, sstatefile))
 
         if tasklist:
@@ -944,11 +946,11 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
         evdata = {'missed': [], 'found': []};
         for tid in missed:
             spec, extrapath, tname = getpathcomponents(tid, d)
-            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), d) + "_" + tname + ".tgz")
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, False, d))
             evdata['missed'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
         for tid in found:
             spec, extrapath, tname = getpathcomponents(tid, d)
-            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), d) + "_" + tname + ".tgz")
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, False, d))
             evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
         bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] sstate: Handle sstate filenames longer than 255 characters
  2020-01-06  0:06 [PATCH 1/4] sstate: Add extra directory level Richard Purdie
  2020-01-06  0:06 ` [PATCH 2/4] sstate: Improve SSTATE_PKG handling Richard Purdie
  2020-01-06  0:06 ` [PATCH 3/4] sstate: Merge file name generation into single function Richard Purdie
@ 2020-01-06  0:06 ` Richard Purdie
  2020-01-06  0:41 ` [PATCH 1/4] sstate: Add extra directory level akuster808
  3 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2020-01-06  0:06 UTC (permalink / raw)
  To: openembedded-core

Many filesystems can't cope with filenames longer that 255 characters.
Add code to detect this and truncate non-essential elements of the filename
to stay within the limit.

[YOCTO #13268]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 71ae0900777..241dace6d9a 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -7,11 +7,28 @@ def generate_sstatefn(spec, hash, taskname, siginfo, d):
     if taskname is None:
        return ""
     extension = ".tgz"
+    # 8 chars reserved for siginfo
+    limit = 254 - 8
     if siginfo:
+        limit = 254
         extension = ".tgz.siginfo"
     if not hash:
         hash = "INVALID"
-    return hash[:2] + "/" + hash[2:4] + "/" + spec + hash + "_" + taskname + extension
+    fn = spec + hash + "_" + taskname + extension
+    # If the filename is too long, attempt to reduce it
+    if len(fn) > limit:
+        components = spec.split(":")
+        # Fields 0,5,6 are mandatory, 1 is most useful, 2,3,4 are just for information
+        # 7 is for the separators
+        avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) / 3
+        components[2] = components[2][:avail]
+        components[3] = components[3][:avail]
+        components[4] = components[4][:avail]
+        spec = ":".join(components)
+        fn = spec + hash + "_" + taskname + extension
+        if len(fn) > limit:
+            bb.fatal("Unable to reduce sstate name to less than 255 chararacters")
+    return hash[:2] + "/" + hash[2:4] + "/" + fn
 
 SSTATE_PKGARCH    = "${PACKAGE_ARCH}"
 SSTATE_PKGSPEC    = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] sstate: Add extra directory level
  2020-01-06  0:06 [PATCH 1/4] sstate: Add extra directory level Richard Purdie
                   ` (2 preceding siblings ...)
  2020-01-06  0:06 ` [PATCH 4/4] sstate: Handle sstate filenames longer than 255 characters Richard Purdie
@ 2020-01-06  0:41 ` akuster808
  2020-01-06  0:43   ` Richard Purdie
  3 siblings, 1 reply; 7+ messages in thread
From: akuster808 @ 2020-01-06  0:41 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core



On 1/5/20 4:06 PM, Richard Purdie wrote:
> 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 sstateI.

I assume zeus worthy?

> Also update tests for new layout.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/classes/sstate.bbclass             |  4 ++--
>  meta/lib/oeqa/selftest/cases/signing.py |  4 ++--
>  meta/lib/oeqa/selftest/cases/sstate.py  |  4 ++--
>  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 c0329cd5d18..7d2cb9eb840 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -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}"
> diff --git a/meta/lib/oeqa/selftest/cases/signing.py b/meta/lib/oeqa/selftest/cases/signing.py
> index b65f3de64c4..9ea31328eff 100644
> --- a/meta/lib/oeqa/selftest/cases/signing.py
> +++ b/meta/lib/oeqa/selftest/cases/signing.py
> @@ -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.')
> diff --git a/meta/lib/oeqa/selftest/cases/sstate.py b/meta/lib/oeqa/selftest/cases/sstate.py
> index 410dec64fcd..80ce9e353c0 100644
> --- a/meta/lib/oeqa/selftest/cases/sstate.py
> +++ b/meta/lib/oeqa/selftest/cases/sstate.py
> @@ -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)
> diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
> index 9bfae9d8323..6a7d2859104 100755
> --- a/scripts/gen-lockedsig-cache
> +++ b/scripts/gen-lockedsig-cache
> @@ -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)
> -
> -    for f in sstate_content_cache[prefix][s]:
> -        files.add(f)
> +    if prefix2 not in sstate_content_cache[prefix]:
> +        sstate_content_cache[prefix][prefix2] = build_sha_cache(prefix + "/" + prefix2)
> +
> +    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)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] sstate: Add extra directory level
  2020-01-06  0:41 ` [PATCH 1/4] sstate: Add extra directory level akuster808
@ 2020-01-06  0:43   ` Richard Purdie
  2020-01-08  3:53     ` Peter Kjellerstedt
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2020-01-06  0:43 UTC (permalink / raw)
  To: akuster808, openembedded-core

On Sun, 2020-01-05 at 16:41 -0800, akuster808 wrote:
> On 1/5/20 4:06 PM, Richard Purdie wrote:
> > 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
> > sstateI.
> 
> I assume zeus worthy?

I think we need to discuss that. It is a fairly significant change in
behaviour.

Options are:

a) none of these
b) only this first change
c) all of them if we want to fix the 255 char sstate filename limit
issue

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] sstate: Add extra directory level
  2020-01-06  0:43   ` Richard Purdie
@ 2020-01-08  3:53     ` Peter Kjellerstedt
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Kjellerstedt @ 2020-01-08  3:53 UTC (permalink / raw)
  To: Richard Purdie, akuster808, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> bounces@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 6 januari 2020 01:44
> To: akuster808 <akuster808@gmail.com>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/4] sstate: Add extra directory level
> 
> On Sun, 2020-01-05 at 16:41 -0800, akuster808 wrote:
> > On 1/5/20 4:06 PM, Richard Purdie wrote:
> > > 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
> > > sstateI.
> >
> > I assume zeus worthy?
> 
> I think we need to discuss that. It is a fairly significant change in
> behaviour.
> 
> Options are:
> 
> a) none of these
> b) only this first change
> c) all of them if we want to fix the 255 char sstate filename limit
> issue
> 
> Cheers,
> 
> Richard

I would like to see at least the first patch being backported. You are 
not alone with huge sstate-cache directories... 

We have not had the problems solved by the other three patches so for 
us at least, they are not required. And they do seem somewhat invasive.

//Peter



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-08  3:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06  0:06 [PATCH 1/4] sstate: Add extra directory level Richard Purdie
2020-01-06  0:06 ` [PATCH 2/4] sstate: Improve SSTATE_PKG handling Richard Purdie
2020-01-06  0:06 ` [PATCH 3/4] sstate: Merge file name generation into single function Richard Purdie
2020-01-06  0:06 ` [PATCH 4/4] sstate: Handle sstate filenames longer than 255 characters Richard Purdie
2020-01-06  0:41 ` [PATCH 1/4] sstate: Add extra directory level akuster808
2020-01-06  0:43   ` Richard Purdie
2020-01-08  3:53     ` Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.