All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] populate_sdk_ext.bbclass: fix corebase identification
@ 2018-06-04 15:38 Damien Riegel
  2018-06-04 15:54 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Riegel @ 2018-06-04 15:38 UTC (permalink / raw)
  To: openembedded-core

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@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')
         else:
             sdkbblayers.append(layer)
-- 
2.17.0



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

* Re: [PATCH] populate_sdk_ext.bbclass: fix corebase identification
  2018-06-04 15:38 [PATCH] populate_sdk_ext.bbclass: fix corebase identification Damien Riegel
@ 2018-06-04 15:54 ` Richard Purdie
  2018-06-04 18:15   ` Damien Riegel
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2018-06-04 15:54 UTC (permalink / raw)
  To: Damien Riegel, openembedded-core

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@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...

Cheers,

Richard


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

* Re: [PATCH] populate_sdk_ext.bbclass: fix corebase identification
  2018-06-04 15:54 ` Richard Purdie
@ 2018-06-04 18:15   ` Damien Riegel
  0 siblings, 0 replies; 3+ messages in thread
From: Damien Riegel @ 2018-06-04 18:15 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

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


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

end of thread, other threads:[~2018-06-04 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-04 15:38 [PATCH] populate_sdk_ext.bbclass: fix corebase identification Damien Riegel
2018-06-04 15:54 ` Richard Purdie
2018-06-04 18:15   ` Damien Riegel

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.