[OE-core] [PATCH 1/2] package_manager: Avoid looking at other multiconfigs for dependencies

Richard Purdie richard.purdie at linuxfoundation.org
Mon Jan 7 14:52:15 UTC 2019


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 at 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




More information about the Openembedded-core mailing list