toaster: resolve missing 'native[sdk]:' prefixes

Submitted by Reyna, David on Feb. 15, 2017, 6:04 a.m. | Patch ID: 137188

Details

Message ID 5E53D14CE4667A45B9A06760DE5D13D0C3430A5A@ALA-MBC.corp.ad.wrs.com
State Superseded
Headers show

Commit Message

Reyna, David Feb. 15, 2017, 6:04 a.m.
From da520beb19ee6a49178ae1181d12d088017acaf1 Mon Sep 17 00:00:00 2001
From: David Reyna <David.Reyna@windriver.com>
Date: Tue, 14 Feb 2017 20:56:30 -0800
Subject: [PATCH] toaster: resolve missing 'native[sdk]:' prefixes

Some task events are missing the 'virtual:native[sdk]:' prefixes.
The Toaster has code to help match missing prefixes, but needs
additional help resolving between 'native:' and 'nativesdk:', by
way of the '_package' event field.

[YOCTO #10849]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 5ed150d..dee40c4 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1258,6 +1258,15 @@  class BuildInfoHelper(object):
                 candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
                 if len(candidates) == 1:
                     identifier = candidates[0]
+                # break tie if missing 'native[sdk]:' prefix
+                if (len(candidates) == 2) and hasattr(event,'_package'):
+                    if 'native-' in event._package:
+                        identifier = 'native:' + identifier
+                    if 'nativesdk-' in event._package:
+                        identifier = 'nativesdk:' + identifier
+                    candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
+                    if len(candidates) == 1:
+                        identifier = candidates[0]
 
         assert identifier in self.internal_state['taskdata']
         identifierlist = identifier.split(":")

Comments

Joshua Lock Feb. 15, 2017, 5:03 p.m.
On Wed, 2017-02-15 at 06:04 +0000, Reyna, David wrote:
> From da520beb19ee6a49178ae1181d12d088017acaf1 Mon Sep 17 00:00:00
> 2001
> From: David Reyna <David.Reyna@windriver.com>
> Date: Tue, 14 Feb 2017 20:56:30 -0800
> Subject: [PATCH] toaster: resolve missing 'native[sdk]:' prefixes
> 
> Some task events are missing the 'virtual:native[sdk]:' prefixes.
> The Toaster has code to help match missing prefixes, but needs
> additional help resolving between 'native:' and 'nativesdk:', by
> way of the '_package' event field.
> 
> [YOCTO #10849]

This v2 looks much neater, thanks!

> 
> Signed-off-by: David Reyna <David.Reyna@windriver.com>
> ---
>  bitbake/lib/bb/ui/buildinfohelper.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> b/bitbake/lib/bb/ui/buildinfohelper.py
> index 5ed150d..dee40c4 100644
> --- a/bitbake/lib/bb/ui/buildinfohelper.py
> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> @@ -1258,6 +1258,15 @@ class BuildInfoHelper(object):
>                  candidates = [x for x in
> self.internal_state['taskdata'].keys() if x.endswith(identifier)]
>                  if len(candidates) == 1:
>                      identifier = candidates[0]
> +                # break tie if missing 'native[sdk]:' prefix
> +                if (len(candidates) == 2) and
> hasattr(event,'_package'):

Out of interest, can we have more than 2 candidates here? Should we
just have something like:

if len(candidates) == 1:
  # pick that identifier
elif len(candidates) > 1 and hasattr(event, '_package'): 
  # break the tie

Thanks,

Joshua

> +                    if 'native-' in event._package:
> +                        identifier = 'native:' + identifier
> +                    if 'nativesdk-' in event._package:
> +                        identifier = 'nativesdk:' + identifier
> +                    candidates = [x for x in
> self.internal_state['taskdata'].keys() if x.endswith(identifier)]
> +                    if len(candidates) == 1:
> +                        identifier = candidates[0]
>  
>          assert identifier in self.internal_state['taskdata']
>          identifierlist = identifier.split(":")
> -- 
> 1.9.1
brian avery March 1, 2017, 4:34 p.m.
was about to push upstream, David did you want to do a V3 first that allows
for candidates >2?
Right now, it only handles 1 or 2 candidates.

-b

On Wed, Feb 15, 2017 at 9:03 AM, Joshua Lock <joshua.g.lock@linux.intel.com>
wrote:

> On Wed, 2017-02-15 at 06:04 +0000, Reyna, David wrote:
> > From da520beb19ee6a49178ae1181d12d088017acaf1 Mon Sep 17 00:00:00
> > 2001
> > From: David Reyna <David.Reyna@windriver.com>
> > Date: Tue, 14 Feb 2017 20:56:30 -0800
> > Subject: [PATCH] toaster: resolve missing 'native[sdk]:' prefixes
> >
> > Some task events are missing the 'virtual:native[sdk]:' prefixes.
> > The Toaster has code to help match missing prefixes, but needs
> > additional help resolving between 'native:' and 'nativesdk:', by
> > way of the '_package' event field.
> >
> > [YOCTO #10849]
>
> This v2 looks much neater, thanks!
>
> >
> > Signed-off-by: David Reyna <David.Reyna@windriver.com>
> > ---
> >  bitbake/lib/bb/ui/buildinfohelper.py | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> > b/bitbake/lib/bb/ui/buildinfohelper.py
> > index 5ed150d..dee40c4 100644
> > --- a/bitbake/lib/bb/ui/buildinfohelper.py
> > +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> > @@ -1258,6 +1258,15 @@ class BuildInfoHelper(object):
> >                  candidates = [x for x in
> > self.internal_state['taskdata'].keys() if x.endswith(identifier)]
> >                  if len(candidates) == 1:
> >                      identifier = candidates[0]
> > +                # break tie if missing 'native[sdk]:' prefix
> > +                if (len(candidates) == 2) and
> > hasattr(event,'_package'):
>
> Out of interest, can we have more than 2 candidates here? Should we
> just have something like:
>
> if len(candidates) == 1:
>   # pick that identifier
> elif len(candidates) > 1 and hasattr(event, '_package'):
>   # break the tie
>
> Thanks,
>
> Joshua
>
> > +                    if 'native-' in event._package:
> > +                        identifier = 'native:' + identifier
> > +                    if 'nativesdk-' in event._package:
> > +                        identifier = 'nativesdk:' + identifier
> > +                    candidates = [x for x in
> > self.internal_state['taskdata'].keys() if x.endswith(identifier)]
> > +                    if len(candidates) == 1:
> > +                        identifier = candidates[0]
> >
> >          assert identifier in self.internal_state['taskdata']
> >          identifierlist = identifier.split(":")
> > --
> > 1.9.1
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
Reyna, David March 1, 2017, 4:35 p.m.
I might as well to a V3 just in case for future proofing (while I look to also  fixing the events themselves to make this obsolete).

I will send it later today.

- David

From: Brian Avery [mailto:avery.brian@gmail.com]

Sent: Wednesday, March 01, 2017 8:34 AM
To: Joshua Lock
Cc: Reyna, David; toaster@yoctoproject.org
Subject: Re: [Toaster] [PATCH] toaster: resolve missing 'native[sdk]:' prefixes

was about to push upstream, David did you want to do a V3 first that allows for candidates >2?
Right now, it only handles 1 or 2 candidates.

-b

On Wed, Feb 15, 2017 at 9:03 AM, Joshua Lock <joshua.g.lock@linux.intel.com<mailto:joshua.g.lock@linux.intel.com>> wrote:
On Wed, 2017-02-15 at 06:04 +0000, Reyna, David wrote:
> From da520beb19ee6a49178ae1181d12d088017acaf1 Mon Sep 17 00:00:00

> 2001

> From: David Reyna <David.Reyna@windriver.com<mailto:David.Reyna@windriver.com>>

> Date: Tue, 14 Feb 2017 20:56:30 -0800

> Subject: [PATCH] toaster: resolve missing 'native[sdk]:' prefixes

>

> Some task events are missing the 'virtual:native[sdk]:' prefixes.

> The Toaster has code to help match missing prefixes, but needs

> additional help resolving between 'native:' and 'nativesdk:', by

> way of the '_package' event field.

>

> [YOCTO #10849]


This v2 looks much neater, thanks!

>

> Signed-off-by: David Reyna <David.Reyna@windriver.com<mailto:David.Reyna@windriver.com>>

> ---

>  bitbake/lib/bb/ui/buildinfohelper.py | 9 +++++++++

>  1 file changed, 9 insertions(+)

>

> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py

> b/bitbake/lib/bb/ui/buildinfohelper.py

> index 5ed150d..dee40c4 100644

> --- a/bitbake/lib/bb/ui/buildinfohelper.py

> +++ b/bitbake/lib/bb/ui/buildinfohelper.py

> @@ -1258,6 +1258,15 @@ class BuildInfoHelper(object):

>                  candidates = [x for x in

> self.internal_state['taskdata'].keys() if x.endswith(identifier)]

>                  if len(candidates) == 1:

>                      identifier = candidates[0]

> +                # break tie if missing 'native[sdk]:' prefix

> +                if (len(candidates) == 2) and

> hasattr(event,'_package'):


Out of interest, can we have more than 2 candidates here? Should we
just have something like:

if len(candidates) == 1:
  # pick that identifier
elif len(candidates) > 1 and hasattr(event, '_package'):
  # break the tie

Thanks,

Joshua

> +                    if 'native-' in event._package:

> +                        identifier = 'native:' + identifier

> +                    if 'nativesdk-' in event._package:

> +                        identifier = 'nativesdk:' + identifier

> +                    candidates = [x for x in

> self.internal_state['taskdata'].keys() if x.endswith(identifier)]

> +                    if len(candidates) == 1:

> +                        identifier = candidates[0]

>

>          assert identifier in self.internal_state['taskdata']

>          identifierlist = identifier.split(":")

> --

> 1.9.1

--
_______________________________________________
toaster mailing list
toaster@yoctoproject.org<mailto:toaster@yoctoproject.org>
https://lists.yoctoproject.org/listinfo/toaster
Reyna, David March 2, 2017, 11:12 a.m.
This is a system generated Comment: Patch 137188 was automatically marked as superseded by patch 137727.