All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] siggen: Fix a subtle bug in hash calculation for shared work tasks
@ 2014-08-23  8:22 Richard Purdie
  2014-08-25 15:02 ` Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2014-08-23  8:22 UTC (permalink / raw)
  To: bitbake-devel


With a shared work task like gcc, the task can be run from a variety of
different recipes which may have different virtual extensions in place.

Depending on whether gcc-runtime or nativesdk-gcc-runtime's do_preconfigure
task is called for example will change the sorting of the task hashes due
to the way clean_basename currently works.

The correct thing to do here is sort on the base filename first, then any
extension when ordering the hashes. This means we do account for things
like recipes with both a native and non-native dependency but we also fix
the shared work case where we don't care whether it was a virtual version
or not.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 933311c..548f50d 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -295,7 +295,7 @@ def dump_this_task(outfile, d):
 
 def clean_basepath(a):
     if a.startswith("virtual:"):
-        b = a.rsplit(":", 1)[0] + ":" + a.rsplit("/", 1)[1]
+        b = a.rsplit("/", 1)[1] + ":" + a.rsplit(":", 1)[0]
     else:
         b = a.rsplit("/", 1)[1]
     return b




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

* Re: [PATCH] siggen: Fix a subtle bug in hash calculation for shared work tasks
  2014-08-23  8:22 [PATCH] siggen: Fix a subtle bug in hash calculation for shared work tasks Richard Purdie
@ 2014-08-25 15:02 ` Peter Kjellerstedt
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2014-08-25 15:02 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

> -----Original Message-----
> From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-
> devel-bounces@lists.openembedded.org] On Behalf Of Richard Purdie
> Sent: den 23 augusti 2014 10:23
> To: bitbake-devel
> Subject: [bitbake-devel] [PATCH] siggen: Fix a subtle bug in hash
> calculation for shared work tasks
> 
> 
> With a shared work task like gcc, the task can be run from a variety of
> different recipes which may have different virtual extensions in place.
> 
> Depending on whether gcc-runtime or nativesdk-gcc-runtime's
> do_preconfigure
> task is called for example will change the sorting of the task hashes
> due
> to the way clean_basename currently works.
> 
> The correct thing to do here is sort on the base filename first, then
> any
> extension when ordering the hashes. This means we do account for things
> like recipes with both a native and non-native dependency but we also
> fix
> the shared work case where we don't care whether it was a virtual
> version
> or not.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
> index 933311c..548f50d 100644
> --- a/bitbake/lib/bb/siggen.py
> +++ b/bitbake/lib/bb/siggen.py
> @@ -295,7 +295,7 @@ def dump_this_task(outfile, d):
> 
>  def clean_basepath(a):
>      if a.startswith("virtual:"):
> -        b = a.rsplit(":", 1)[0] + ":" + a.rsplit("/", 1)[1]
> +        b = a.rsplit("/", 1)[1] + ":" + a.rsplit(":", 1)[0]
>      else:
>          b = a.rsplit("/", 1)[1]
>      return b

After the rewrite above, this can be simplified as:

def clean_basepath(a):
    b = a.rsplit("/", 1)[1]
    if a.startswith("virtual:"):
        b += ":" + a.rsplit(":", 1)[0]
    return b

//Peter



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

end of thread, other threads:[~2014-08-25 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-23  8:22 [PATCH] siggen: Fix a subtle bug in hash calculation for shared work tasks Richard Purdie
2014-08-25 15:02 ` Peter Kjellerstedt

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.