runqueue: Print pseudo.log if fakeroot task failed
PATCH v4 1/1 runqueue: Print pseudo.log if fakeroot task failed
Currently if pseudo fails we can only see the path to pseudo.log. If we have no access to server and can only rely on bitbake log then debugging becomes impossible. This printing needs to be added in runqueue level, not inside task execution, because in some cases task fails with pseudo abort really early and we don't even see any log.
In this change I'm adding pseudo log printing in every fakeroot task failure that logged mismatch, error or fatal to logfile, because we have no other way to communicate with pseudo if it failed or not. Only lines from last pseudo server execution will be printed.
--- v4 get taskfn and fakerootlog in runQueuePipe separately for every task, not for every fakeworker (per multiconfig) in RunQueue
--- lib/bb/cache.py | 3 +++ lib/bb/runqueue.py | 46 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 9 deletions(-)
lib/bb/cache.py +3 -0
@@ -126,6 +126,7 @@ class CoreRecipeInfo(RecipeInfoCommon): self.inherits = self.getvar('__inherit_cache', metadata, expand=False) self.fakerootenv = self.getvar('FAKEROOTENV', metadata) self.fakerootdirs = self.getvar('FAKEROOTDIRS', metadata) + self.fakerootlogs = self.getvar('FAKEROOTLOGS', metadata) self.fakerootnoenv = self.getvar('FAKEROOTNOENV', metadata) self.extradepsfunc = self.getvar('calculate_extra_depends', metadata)
@@ -163,6 +164,7 @@ class CoreRecipeInfo(RecipeInfoCommon): cachedata.fakerootenv = {} cachedata.fakerootnoenv = {} cachedata.fakerootdirs = {} + cachedata.fakerootlogs = {} cachedata.extradepsfunc = {} def add_cacheData(self, cachedata, fn):
@@ -231,6 +233,7 @@ class CoreRecipeInfo(RecipeInfoCommon): cachedata.fakerootenv[fn] = self.fakerootenv cachedata.fakerootnoenv[fn] = self.fakerootnoenv cachedata.fakerootdirs[fn] = self.fakerootdirs + cachedata.fakerootlogs[fn] = self.fakerootlogs cachedata.extradepsfunc[fn] = self.extradepsfunc def virtualfn2realfn(virtualfn):
lib/bb/runqueue.py +37 -9
113 lines not on this page · raw message
Signature · 1 line
2.30.1
Quoted 10 lines · Tomasz Dziendzielski
Currently if pseudo fails we can only see the path to pseudo.log. If we have no access to server and can only rely on bitbake log then debugging becomes impossible. This printing needs to be added in runqueue level, not inside task execution, because in some cases task fails with pseudo abort really early and we don't even see any log.
In this change I'm adding pseudo log printing in every fakeroot task failure that logged
mismatch,errororfatalto logfile, because we have no other way to communicate with pseudo if it failed or not. Only lines from last pseudo server execution will be printed.
I don't think this is going to work as it has the same issue as with taskfn.
There are only two bitbake-worker processes started and these fork off individual processes. The fakeroot enrvionment is adjusted in those workers as the tasks are started and pseudo will reread from the environment. The log analysis code will need to update to the current process' environment too...
Cheers,
Richard
Quoted 7 lines · Tomasz Dziendzielski
Quoted 6 lines
Currently if pseudo fails we can only see the path to pseudo.log. If we have no access to server and can only rely on bitbake log then debugging becomes impossible. This printing needs to be added in runqueue level, not inside task execution, because in some cases task fails with pseudo abort really early and we don't even see any log.
Quoted 6 lines
Quoted 4 lines
In this change I'm adding pseudo log printing in every fakeroot task failure that logged
mismatch,errororfatalto logfile, because we have no other way to communicate with pseudo if it failed or not. Only lines from last pseudo server execution will be printed.I don't think this is going to work as it has the same issue as with
taskfn.
Quoted 6 lines
There are only two bitbake-worker processes started and these fork off individual processes. The fakeroot enrvionment is adjusted in those workers as the tasks are started and pseudo will reread from the environment. The log analysis code will need to update to the current process' environment too...
It's not the same issue. In this case we loop over each tasks in queue:
while found and len(self.queue):
...
while index != -1 and self.queue.startswith(b"<exitcode>"):
try:
task, status = pickle.loads(self.queue[10:index])
...
(_, _, _, taskfn) = split_tid_mcfn(task) fakerootlog = None
if self.fakerootlogs and taskfn and taskfn in
self.fakerootlogs:
fakerootlog = self.fakerootlogs[taskfn]
self.rqexec.runqueue_process_waitpid(task, status,
fakerootlog=fakerootlog)
so every time we get a new task, new taskfn and then new (correct) pseudo log path specific for each task.
To verify this I triggered more than one pseudo abort in one build and I got correct pseudo logs printed for each failed fakeroot task. For comparison, with the previous patch I'm getting the same (wrong) pseudo log printed multiple times.
Best regards,
Tomasz Dziendzielski
Quoted 34 lines · Tomasz Dziendzielski
Quoted 12 lines · Tomasz Dziendzielski
Quoted 10 lines
Currently if pseudo fails we can only see the path to pseudo.log. If we have no access to server and can only rely on bitbake log then debugging becomes impossible. This printing needs to be added in runqueue level, not inside task execution, because in some cases task fails with pseudo abort really early and we don't even see any log.
In this change I'm adding pseudo log printing in every fakeroot task failure that logged
mismatch,errororfatalto logfile, because we have no other way to communicate with pseudo if it failed or not. Only lines from last pseudo server execution will be printed.Quoted 7 lines
I don't think this is going to work as it has the same issue as with taskfn.
There are only two bitbake-worker processes started and these fork off individual processes. The fakeroot enrvionment is adjusted in those workers as the tasks are started and pseudo will reread from the environment. The log analysis code will need to update to the current process' environment too...
It's not the same issue. In this case we loop over each tasks in queue:
while found and len(self.queue):
...
while index != -1 andself.queue.startswith(b"<exitcode>"):
try:
task, status =pickle.loads(self.queue[10:index])
...
(_, _, _, taskfn) =split_tid_mcfn(task)
fakerootlog = None
if self.fakerootlogs and taskfn and taskfn in self.fakerootlogs:
fakerootlog = self.fakerootlogs[taskfn]self.rqexec.runqueue_process_waitpid(task, status, fakerootlog=fakerootlog)
Quoted 6 lines
so every time we get a new task, new taskfn and then new (correct) pseudo log path specific for each task.
To verify this I triggered more than one pseudo abort in one build and I got correct pseudo logs printed for each failed fakeroot task. For comparison, with the previous patch I'm getting the same (wrong) pseudo log printed multiple times.
You're right, I did misread the patch earlier, sorry. I'll queue it for testing, thanks.
Cheers,
Richard