Skip to contentSkip to conversation

lib/oe/sstate: Add task_resolved handler for virtual/xxx mappings

PATCH In review Richard Purdie 1 participant 2 messages Sep 30, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/oe/sstate: Add task_resolved handler for virtual/xxx mappings

In SIGGEN_EXCLUDERECIPES_ABISAFE and SIGGEN_EXCLUDE_SAFE_RECIPE_DEP we really need to be able to use virtual/xxx namespaces but this currently doesn't work.

To make this work, we need to translate them into the resolved providers. After such a hook was added to bitbake, we can add this translation here.

meta/lib/oe/sstatesig.py +22 -0
index cba0a84..fa41145 100644
@@ -94,6 +94,28 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
         self.machine = data.getVar("MACHINE", True)
         self.mismatch_msgs = []
         pass
+
+    def tasks_resolved(self, virtmap, virtpnmap, dataCache):
+        # Translate virtual/xxx entries to PN values
+        newabisafe = []
+        for a in self.abisaferecipes:
+            if a in virtpnmap:
+                newabisafe.append(virtpnmap[a])
+            else:
+                newabisafe.append(a)
+        self.abisaferecipes = newabisafe
+        newsafedeps = []
+        for a in self.saferecipedeps:
+            a1, a2 = a.split("->")
+            if a1 in virtpnmap:
+                a1 = virtpnmap[a1]
+            if a2 in virtpnmap:
+                a2 = virtpnmap[a2]
+            newsafedeps.append(a1 + "->" + a2)
+        self.saferecipedeps = newsafedeps
+        bb.warn(str(self.abisaferecipes))
+        bb.warn(str(self.saferecipedeps))
+
     def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
         return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
 
#1 lore raw
Quoted 29 lines · Richard Purdie

In SIGGEN_EXCLUDERECIPES_ABISAFE and SIGGEN_EXCLUDE_SAFE_RECIPE_DEP we really need to be able to use virtual/xxx namespaces but this currently doesn't work.

To make this work, we need to translate them into the resolved providers. After such a hook was added to bitbake, we can add this translation here.

meta/lib/oe/sstatesig.py +11 -0
index cba0a84..fa41145 100644
@@ -94,6 +94,28 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
         self.machine = data.getVar("MACHINE", True)
         self.mismatch_msgs = []
         pass
+
+    def tasks_resolved(self, virtmap, virtpnmap, dataCache):
+        # Translate virtual/xxx entries to PN values
+        newabisafe = []
+        for a in self.abisaferecipes:
+            if a in virtpnmap:
+                newabisafe.append(virtpnmap[a])
+            else:
+                newabisafe.append(a)
+        self.abisaferecipes = newabisafe
+        newsafedeps = []

meta/lib/oe/sstatesig.py class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash): · line 117

Quoted 10 lines
meta/lib/oe/sstatesig.py +10 -0
+        for a in self.saferecipedeps:
+            a1, a2 = a.split("->")
+            if a1 in virtpnmap:
+                a1 = virtpnmap[a1]
+            if a2 in virtpnmap:
+                a2 = virtpnmap[a2]
+            newsafedeps.append(a1 + "->" + a2)
+        self.saferecipedeps = newsafedeps
+        bb.warn(str(self.abisaferecipes))
+        bb.warn(str(self.saferecipedeps))

Yes, I left some debug in here, I'll remove these two lines sorry!

Cheers,

Richard