[Toaster] [PATCH] cooker: replace use of map() with list comprehension
Smith, Elliot
elliot.smith at intel.com
Tue Jun 14 03:31:49 PDT 2016
Please ignore, as the patch this is based on has been rejected from bitbake.
Elliot
On 14 June 2016 at 10:04, Elliot Smith <elliot.smith at intel.com> wrote:
> In Python 3, map() returns an interator rather than a list.
> This causes problems for Toaster, which is unable to process
> the BuildInit event when it is received. This causes the
> build to "hang" from Toaster's point of view.
>
> Replace the call to map() with a list comprehension instead,
> which returns the list which Toaster is expecting and enables
> builds to register.
>
> Signed-off-by: Elliot Smith <elliot.smith at intel.com>
> ---
> bitbake/lib/bb/cooker.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index 0a0b362..204709c 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1367,7 +1367,7 @@ class BBCooker:
>
> # build a list of target:task strings in format
> # ['zlib:do_build', 'mpfr-native:do_build', ...]
> - packages = map(lambda target: "%s:do_%s" % (target, task),
> targets)
> + packages = ["%s:do_%s" % (target, task) for target in targets]
> bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
>
> def buildTargetsIdle(server, rq, abort):
> --
> 2.7.4
>
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20160614/e3c002af/attachment.html>
More information about the toaster
mailing list