summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/build.py67
1 files changed, 36 insertions, 31 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index a4deb00b88..c632a271fe 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -385,39 +385,44 @@ exit $ret
385 else: 385 else:
386 bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress)) 386 bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress))
387 387
388 fifobuffer = bytearray()
388 def readfifo(data): 389 def readfifo(data):
389 lines = data.split(b'\0') 390 nonlocal fifobuffer
390 for line in lines: 391 fifobuffer.extend(data)
391 # Just skip empty commands 392 while fifobuffer:
392 if not line: 393 message, token, nextmsg = fifobuffer.partition(b"\00")
393 continue 394 if token:
394 splitval = line.split(b' ', 1) 395 splitval = message.split(b' ', 1)
395 cmd = splitval[0].decode("utf-8") 396 cmd = splitval[0].decode("utf-8")
396 if len(splitval) > 1: 397 if len(splitval) > 1:
397 value = splitval[1].decode("utf-8") 398 value = splitval[1].decode("utf-8")
398 else: 399 else:
399 value = '' 400 value = ''
400 if cmd == 'bbplain': 401 if cmd == 'bbplain':
401 bb.plain(value) 402 bb.plain(value)
402 elif cmd == 'bbnote': 403 elif cmd == 'bbnote':
403 bb.note(value) 404 bb.note(value)
404 elif cmd == 'bbwarn': 405 elif cmd == 'bbwarn':
405 bb.warn(value) 406 bb.warn(value)
406 elif cmd == 'bberror': 407 elif cmd == 'bberror':
407 bb.error(value) 408 bb.error(value)
408 elif cmd == 'bbfatal': 409 elif cmd == 'bbfatal':
409 # The caller will call exit themselves, so bb.error() is 410 # The caller will call exit themselves, so bb.error() is
410 # what we want here rather than bb.fatal() 411 # what we want here rather than bb.fatal()
411 bb.error(value) 412 bb.error(value)
412 elif cmd == 'bbfatal_log': 413 elif cmd == 'bbfatal_log':
413 bb.error(value, forcelog=True) 414 bb.error(value, forcelog=True)
414 elif cmd == 'bbdebug': 415 elif cmd == 'bbdebug':
415 splitval = value.split(' ', 1) 416 splitval = value.split(' ', 1)
416 level = int(splitval[0]) 417 level = int(splitval[0])
417 value = splitval[1] 418 value = splitval[1]
418 bb.debug(level, value) 419 bb.debug(level, value)
420 else:
421 bb.warn("Unrecognised command '%s' on FIFO" % cmd)
422 fifobuffer = nextmsg
419 else: 423 else:
420 bb.warn("Unrecognised command '%s' on FIFO" % cmd) 424 break
425
421 tempdir = d.getVar('T', True) 426 tempdir = d.getVar('T', True)
422 fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid()) 427 fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
423 if os.path.exists(fifopath): 428 if os.path.exists(fifopath):