Skip to contentSkip to conversation

sstate: Improve confusing debug message

PATCH New Richard Purdie 1 participant 2 messages May 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sstate: Improve confusing debug message

The entry being removed is a file, not a manifest, so improve the debug message to reflect that and be slightly less confusing.

---
 meta/classes-global/sstate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/sstate.bbclass +1 -1
index 1dfcb5d0a3b..ce9baf58165 100644
@@ -478,7 +478,7 @@ def sstate_clean_manifest(manifest, d, canrace=False, prefix=None):
         entry = entry.strip()
         if prefix and not entry.startswith("/"):
             entry = prefix + "/" + entry
-        bb.debug(2, "Removing manifest: %s" % entry)
+        bb.debug(2, "Removing file: %s" % entry)
         # We can race against another package populating directories as we're removing them
         # so we ignore errors here.
         try:
#1 lore raw

PATCH 2/2 sstate: Detect broken sstate paths containing tmpdir

sstate objects should not contain TMPDIR paths. Detect this and error if found as the side effects are quite problematic.

[YOCTO #16281]

---
 meta/classes-global/sstate.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/classes-global/sstate.bbclass +6 -1
index ce9baf58165..90d80b6f282 100644
@@ -654,10 +654,15 @@ def sstate_package(ss, d):
                     continue
                 bb.error("sstate found an absolute path symlink %s pointing at %s. Please replace this with a relative link." % (srcpath, link))
                 exit = True
+            for dir in dirs:
+                dir = os.path.join(walkroot, dir).removeprefix(state[1])
+                if tmpdir in dir:
+                    bb.error("sstate found a tmpdir path reference in installation directiory %s which must be removed." % dir)
+                    exit = True
         bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
         bb.utils.rename(state[1], sstatebuild + state[0])
     if exit:
-        bb.fatal("Failing task due to absolute path symlinks")
+        bb.fatal("Failing task due to absolute path symlinks or tmpdir path reference")
 
     workdir = d.getVar('WORKDIR')
     sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared")