cooker: replace use of map() with list comprehension
PATCH 1/1 cooker: replace use of map() with list comprehension
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.
--- bitbake/lib/bb/cooker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +1 -1
@@ -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):
Signature · 1 line
2.7.4
Please ignore, as the patch this is based on has been rejected from bitbake.
Elliot
Quoted 43 lines · Elliot Smith
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 <[email protected]>--- bitbake/lib/bb/cooker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)bitbake/lib/bb/cooker.py +1
-1@@ -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 47This 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.
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre