-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb-log-find-fails
executable file
·42 lines (34 loc) · 1.08 KB
/
bb-log-find-fails
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/env python3
# Given a bitbake log, identify what tasks were running in parallel with any
# failed tasks.
#
# Helpful when you suspect that there is a race in the build tree, such as two
# tasks writing to the same file.
#
# Licensed under the MIT license
import sys, re
started_re = re.compile(r"NOTE: recipe (?P<recipe>.+): task (?P<task>.+): Started")
ended_re = re.compile(r"NOTE: recipe (?P<recipe>.+): task (?P<task>.+): Succeeded")
failed_re = re.compile(r"NOTE: recipe (?P<recipe>.+): task (?P<task>.+): Failed")
def name(match):
return match.group("recipe") + ":" + match.group("task")
active = set()
for line in open(sys.argv[1], encoding="utf-8"):
m = started_re.search(line)
if m:
active.add(name(m))
continue
m = ended_re.search(line)
if m:
active.remove(name(m))
continue
m = failed_re.search(line)
if m:
task = name(m)
print("Task %s failed" % task)
print("Active tasks are:")
for t in active:
print(" %s" % t)
print()
active.remove(task)
continue