Skip to contentSkip to conversation

package_manager: Avoid looking at other multiconfigs for dependencies

PATCH In review Alejandro Enedino Hernandez Samaniego 2 participants 2 messages Jan 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package_manager: Avoid looking at other multiconfigs for dependencies

When creating the rootfs, we look at direct and indirect dependencies and then after processing them we create a link for rpm/ipk/deb packages needed for each of them on the deploy directory.

The process looks at dependencies that we've already seen to avoid copying them twice, but when BB_MULTICONFIG is enabled, the dependencies themsevlves contain "mc:<mc_name>" in them, so duplicate packages are not found if they come from different multiconfigs, causing an error when linking the package file since it already exists.

Check which multiconfig we are currently building and avoid processing dependencies from other multiconfigs.

---
 meta/lib/oe/package_manager.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/lib/oe/package_manager.py +11 -1
index 392fe7e..444da5d 100644
@@ -643,10 +643,11 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
 
     taskdepdata = d.getVar("BB_TASKDEPDATA", False)
     mytaskname = d.getVar("BB_RUNTASK")
+    mc = d.getVar("BB_CURRENT_MC")
     pn = d.getVar("PN")
     seendirs = set()
     multilibs = {}
-   
+
     bb.utils.remove(subrepo_dir, recurse=True)
     bb.utils.mkdirhier(subrepo_dir)
 
@@ -660,6 +661,10 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
     for dep in taskdepdata:
         data = taskdepdata[dep]
         if data[1] == mytaskname and data[0] == pn:
+            if mc != 'default':
+                depmc = dep.split(':')[1]
+                if depmc != mc:
+                    continue
             start = dep
             break
     if start is None:
@@ -673,6 +678,11 @@ def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie
         next = []
         for dep2 in start:
             for dep in taskdepdata[dep2][3]:
+                # We shouldnt care of other multiconfigs
+                if mc != 'default':
+                    depmc = dep.split(':')[1]
+                    if depmc != mc:
+                        continue
                 if taskdepdata[dep][0] != pn:
                     if "do_" + taskname in dep:
                         pkgdeps.add(dep)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 46 lines · Alejandro Enedino Hernandez Samaniego

When creating the rootfs, we look at direct and indirect dependencies and then after processing them we create a link for rpm/ipk/deb packages
needed for each of them on the deploy directory.

The process looks at dependencies that we've already seen to avoid copying them twice, but when BB_MULTICONFIG is enabled, the dependencies
themsevlves contain "mc:<mc_name>" in them, so duplicate packages are not found if they come from different multiconfigs, causing an error when linking the package file since it already exists.

Check which multiconfig we are currently building and avoid processing
dependencies from other multiconfigs.

Signed-off-by: Alejandro Enedino Hernandez Samaniego < [email protected]>

---
 meta/lib/oe/package_manager.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/lib/oe/package_manager.py +0 -0
index 392fe7e..444da5d 100644
@@ -643,10 +643,11 @@ def create_packages_dir(d, subrepo_dir,

deploydir, taskname, filterbydependencie

taskdepdata = d.getVar("BB_TASKDEPDATA", False) mytaskname = d.getVar("BB_RUNTASK")

meta/lib/oe/package_manager.py +2 -1
+    mc = d.getVar("BB_CURRENT_MC")
     pn = d.getVar("PN")
     seendirs = set()
     multilibs = {}
-   
+
     bb.utils.remove(subrepo_dir, recurse=True)
     bb.utils.mkdirhier(subrepo_dir)
@@ -660,6 +661,10 @@ def create_packages_dir(d, subrepo_dir,

deploydir, taskname, filterbydependencie
for dep in taskdepdata:
data = taskdepdata[dep]
if data[1] == mytaskname and data[0] == pn:

meta/lib/oe/package_manager.py def create_packages_dir(d, subrepo_dir, deploydir, taskname, filterbydependencie · line 667

Quoted 4 lines
meta/lib/oe/package_manager.py +4 -0
+            if mc != 'default':
+                depmc = dep.split(':')[1]
+                if depmc != mc:
+                    continue

Is this the right test?

Don't we also need a "if mc == 'default', dep not startswith 'multiconfig:' ?

i.e. what happens if we're the default mc but we find a multiconfig dependency?

I think to fix this properly we may need to add an "mc" element to taskdepdata. We can then just do:

mc = d.getVar("BB_CURRENT_MC")

if mc == "default":

    mc = ""

if data[1] == mytaskname and data[0] == pn and data[X] == mc:

It means a bitbake version bump but its the right time to do that and fix this properly so the code reads understandably. The "default" string was probably a bad idea in hindsight :(

Cheers,

Richard