All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] package_manager: Avoid looking at other multiconfigs for dependencies
@ 2019-01-05 21:16 Alejandro Enedino Hernandez Samaniego
  2019-01-07 14:52 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Enedino Hernandez Samaniego @ 2019-01-05 21:16 UTC (permalink / raw)
  To: openembedded-core

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 <alejandr@xilinx.com>
---
 meta/lib/oe/package_manager.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 392fe7e..444da5d 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -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)
-- 
2.7.4



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

* Re: [PATCH 1/2] package_manager: Avoid looking at other multiconfigs for dependencies
  2019-01-05 21:16 [PATCH 1/2] package_manager: Avoid looking at other multiconfigs for dependencies Alejandro Enedino Hernandez Samaniego
@ 2019-01-07 14:52 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2019-01-07 14:52 UTC (permalink / raw)
  To: Alejandro Enedino Hernandez Samaniego, openembedded-core

On Sat, 2019-01-05 at 13:16 -0800, Alejandro Enedino Hernandez
Samaniego wrote:
> 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 <
> alejandr@xilinx.com>
> ---
>  meta/lib/oe/package_manager.py | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/package_manager.py
> b/meta/lib/oe/package_manager.py
> index 392fe7e..444da5d 100644
> --- a/meta/lib/oe/package_manager.py
> +++ b/meta/lib/oe/package_manager.py
> @@ -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

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




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

end of thread, other threads:[~2019-01-07 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-05 21:16 [PATCH 1/2] package_manager: Avoid looking at other multiconfigs for dependencies Alejandro Enedino Hernandez Samaniego
2019-01-07 14:52 ` Richard Purdie

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.