Bug 6317 - Incorrect dependencies for -native recipes
Summary: Incorrect dependencies for -native recipes
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-05-13 08:41 UTC by Richard Purdie
Modified: 2021-01-31 10:43 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2014-05-13 08:41:57 UTC
If we have a recipe PN = "x" which has RDEPENDS_y = "z" (where y is a subpackage of x) and then we build x-native, it doesn't have a dependency on z-native.

This is due to the way native.bbclass extends recipes to a native version. It will look at:

RDEPENDS_x and RDEPENDS_${PN} as well as RDEPENDS but it will not look at subpackages.

Extending it to cover subpackages is non-trivial, not least that PACKAGES="" in native.bbclass.
Comment 1 Tomasz Dziendzielski 2021-01-27 23:28:53 UTC
Can't we just get subpackages names with:
>sorted((key for key in d.keys() if key.startswith("RDEPENDS_")))
?

Then how do we map package from RDEPENDS to recipe name that we should add to DEPENDS? For example if we have RDEPENDS_y = "z-dev" how to get "z" the correct way?
Comment 2 Richard Purdie 2021-01-31 10:42:50 UTC
(In reply to comment #1)
> Can't we just get subpackages names with:
> >sorted((key for key in d.keys() if key.startswith("RDEPENDS_")))
> ?

In theory we could however iterating d.keys() is extremely expensive and even in bitbake, we avoid it at all costs.

There is a much simpler way which is not to clear PACKAGES in the native case, then not only could we do the above more efficiently, but bitbake itself already handles it for us.

> Then how do we map package from RDEPENDS to recipe name that we should add
> to DEPENDS? For example if we have RDEPENDS_y = "z-dev" how to get "z" the
> correct way?

Bitbake already handles this internally for the target recipe cases so we're just going to use the same mechanism for the native case.

The way it works is that bitbake knows about PACKAGES and can therefore know that z-dev is provided by a specific recipe.