[OE-core] [PATCH] populate_sdk_ext.bbclass: fix corebase identification
Damien Riegel
damien.riegel at savoirfairelinux.com
Mon Jun 4 18:15:41 UTC 2018
On Mon, Jun 04, 2018 at 04:54:08PM +0100, Richard Purdie wrote:
> On Mon, 2018-06-04 at 11:38 -0400, Damien Riegel wrote:
> > When generating the extended SDK, there is a copy step where this
> > class
> > goes through the layers and other stuff that have been copied to
> > generate the SDK.
> >
> > The corebase; ie. the folder that contains the core layer 'meta' is
> > treated in a special way. Unfortunately in our tree, we have:
> >
> > layers/meta/meta
> > | `- core layer
> > `------- corebase
> >
> > When populate_sdk_ext checks this layer, it thinks wrongly that it's
> > the
> > corebase folder, so it treats it differently and doesn't add it to
> > the
> > layer list. When bitbake tries to run in the generated SDK, it will
> > fail
> > because it doesn't find information stored in that layer.
> >
> > This patch makes sure only the corebase folder is identified as so.
> >
> > Signed-off-by: Damien Riegel <damien.riegel at savoirfairelinux.com>
> > ---
> > meta/classes/populate_sdk_ext.bbclass | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/populate_sdk_ext.bbclass
> > b/meta/classes/populate_sdk_ext.bbclass
> > index 2dd21237e2..917fbfa1b4 100644
> > --- a/meta/classes/populate_sdk_ext.bbclass
> > +++ b/meta/classes/populate_sdk_ext.bbclass
> > @@ -207,7 +207,7 @@ python copy_buildsystem () {
> > sdkbblayers = []
> > corebase = os.path.basename(d.getVar('COREBASE'))
> > for layer in layers_copied:
> > - if corebase == os.path.basename(layer):
> > + if corebase == layer:
> > conf_bbpath = os.path.join('layers', layer, 'bitbake')
> >
>
> Whilst I appreciate the problem, the fix doesn't look like it would
> work for other use cases since its comparing a basename on one side and
> a non-basename on the other...
Well, the issue is precisely caused by the comparison of basenames.
>>> os.path.basename("meta/meta")
'meta'
>>> os.path.basename("meta")
'meta'
So it doesn't differentiate between a layer within corebase and corebase
itself. copy_bitbake_and_layers seems to do the comparison differently
[1]. Arguably there, it's comparison between absolute paths, but still.
Do you have suggestions on how I could fix this bug otherwise? Maybe
copy_bitbake_and_layers could return a tuple (corebase, layers) instead
of a list that contains copied_layers + corebase.
[1] https://github.com/openembedded/openembedded-core/blob/master/meta/lib/oe/copy_buildsystem.py#L91
Thank for the feedback,
--
Damien
More information about the Openembedded-core
mailing list