On 1/28/21 9:55 AM, Tomasz Dziendzielski wrote:
When we run `devtool build mc` recipe's task dependencies are expanded
to "mc:do_populate_sysroot" where "mc" name is treated as multiconfig
and "do_package_sysroot" as multiconfigname.

Hmm, this might be problematic, since "bitbake -e mc:foo" needs to keep working to dump the base environment for the "foo" multiconfig, and I think this patch will break that (although I didn't test it to verify)



| ERROR: Multiconfig dependency mc:do_populate_sysroot depends on
| nonexistent multiconfig configuration named do_populate_sysroot

Signed-off-by: Tomasz Dziendzielski <[email protected]>
---
  bitbake/lib/bb/cache.py    | 4 ++--
  bitbake/lib/bb/cooker.py   | 6 +++---
  bitbake/lib/bb/runqueue.py | 6 +++---
  bitbake/lib/bb/siggen.py   | 2 +-
  4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 36270d0093..5497da384f 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -238,7 +238,7 @@ def virtualfn2realfn(virtualfn):
      Convert a virtual file name to a real one + the associated subclass 
keyword
      """
      mc = ""
-    if virtualfn.startswith('mc:'):
+    if virtualfn.startswith('mc:') and virtualfn.count(':') == 2:
          elems = virtualfn.split(':')
          mc = elems[1]
          virtualfn = ":".join(elems[2:])
@@ -268,7 +268,7 @@ def variant2virtual(realfn, variant):
      """
      if variant == "":
          return realfn
-    if variant.startswith("mc:"):
+    if variant.startswith("mc:") and variant.count(':') == 2:
          elems = variant.split(":")
          if elems[2]:
              return "mc:" + elems[1] + ":virtual:" + ":".join(elems[2:]) + ":" 
+ realfn
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 83cfee7fb4..3d8dbd6065 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -533,7 +533,7 @@ class BBCooker:
              self.reset()
def mc_base(p):
-            if p.startswith('mc:'):
+            if p.startswith('mc:') and p.count(':') == 2:
                  s = p.split(':')
                  if len(s) == 2:
                      return s[1]
@@ -614,7 +614,7 @@ class BBCooker:
          # Replace string such as "mc:*:bash"
          # into "mc:A:bash mc:B:bash bash"
          for k in targetlist:
-            if k.startswith("mc:"):
+            if k.startswith("mc:") and k.count(':') == 2:
                  if wildcard:
                      bb.fatal('multiconfig conflict')
                  if k.split(":")[1] == "*":
@@ -648,7 +648,7 @@ class BBCooker:
          for k in fulltargetlist:
              origk = k
              mc = ""
-            if k.startswith("mc:"):
+            if k.startswith("mc:") and k.count(':') == 2:
                  mc = k.split(":")[1]
                  k = ":".join(k.split(":")[2:])
              ktask = task
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 28bdadb45e..d1fcb7cea4 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -38,7 +38,7 @@ def taskname_from_tid(tid):
      return tid.rsplit(":", 1)[1]
def mc_from_tid(tid):
-    if tid.startswith('mc:'):
+    if tid.startswith('mc:') and tid.count(':') == 2:
          return tid.split(':')[1]
      return ""
@@ -47,13 +47,13 @@ def split_tid(tid):
      return (mc, fn, taskname)
def split_mc(n):
-    if n.startswith("mc:"):
+    if n.startswith("mc:") and n.count(':') == 2:
          _, mc, n = n.split(":", 2)
          return (mc, n)
      return ('', n)
def split_tid_mcfn(tid):
-    if tid.startswith('mc:'):
+    if tid.startswith('mc:') and tid.count(':') == 2:
          elems = tid.split(':')
          mc = elems[1]
          fn = ":".join(elems[2:-1])
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 0ac3952466..6859a7207b 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -748,7 +748,7 @@ def clean_basepath(basepath):
      if basepath[0] == '/':
          return cleaned
- if basepath.startswith("mc:"):
+    if basepath.startswith("mc:") and basepath.count(':') == 2:
          mc, mc_name, basepath = basepath.split(":", 2)
          mc_suffix = ':mc:' + mc_name
      else:



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#147395): 
https://lists.openembedded.org/g/openembedded-core/message/147395
Mute This Topic: https://lists.openembedded.org/mt/80186365/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to