runqueue: Print pseudo.log if fakeroot task failed
PATCH v3 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.
--- v3 use separate FAKEROOTLOGS variable with pseudo.log path from meta/conf/bitbake.conf, change var names from pseudo to fakeroot
--- lib/bb/cache.py | 3 +++ lib/bb/runqueue.py | 53 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 14 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 +39 -14
143 lines not on this page · raw message
Signature · 1 line
2.30.1
Hello,
I found a worrying issue in runqueue.py exposed by this patch. Lately I encountered a few cases where pseudo.log was not printed on pseudo abort. I added some debug prints and it seems in some cases (where we build the whole image, not single recipe) taskfn is set incorrectly.
The recipe X failed with task log:
| Check logfile: X_WORKDIR/pseudo//pseudo.log | ... | ERROR: Logfile of failure stored in: X_WORKDIR/temp/log.do_install.34470
but the debug line printing taskfn value and pseudo.log path taken from dictionary (based on taskfn) showed:
| WARNING: taskfn: PATH/Y.bb pseudo_log: Y_WORKDIR/pseudo/pseudo.log And since there were no pseudo abort in Y recipe the log was not printed. (Please note that this warning comes from the failed task from X recipe)
The important note is that I don't change the value of taskfn with a patch sent under this subject, so it's unlikely that my patch introduced this behaviour. In this patch I just pass current taskfn value to start_fakeworker(), so in fact it's value is already wrong in the execute() method. It means something else might also be broken and not yet detected. Please correct me if I made some wrong assumption. Maybe taskfn is expected to have some different value and I just shouldn't depend on it? I can't be 100% sure it's not related to my changes, that's why I'm writing in this thread, instead of submitting a bug.
Best regards,
Tomasz Dziendzielski
Quoted 13 lines · Tomasz Dziendzielski
Hello,
I found a worrying issue inrunqueue.pyexposed by this patch. Lately I encountered a few cases where pseudo.log was not printed on pseudo abort. I added some debug prints and it seems in some cases (where we build the whole image, not single recipe) taskfn is set incorrectly.
The recipe X failed with task log:| Check logfile: X_WORKDIR/pseudo//pseudo.log | ... | ERROR: Logfile of failure stored in: X_WORKDIR/temp/log.do_install.34470but the debug line printing taskfn value and pseudo.log path taken from dictionary (based on taskfn) showed:
| WARNING: taskfn: PATH/Y.bbpseudo_log: Y_WORKDIR/pseudo/pseudo.log
And since there were no pseudo abort in Y recipe the log was not printed. (Please note that this warning comes from the failed task from X recipe)
Quoted 8 lines
The important note is that I don't change the value of taskfn with a patch sent under this subject, so it's unlikely that my patch introduced this behaviour. In this patch I just pass current taskfn value to
start_fakeworker(), so in fact it's value is already wrong in theexecute()method. It means something else might also be broken and not yet detected. Please correct me if I made some wrong assumption. Maybe taskfn is expected to have some different value and I just shouldn't depend on it? I can't be 100% sure it's not related to my changes, that's why I'm writing in this thread, instead of submitting a bug.
I'm afraid it is your patch. There is only one fake worker started per multiconfig and therefore the taskfn is being set to the value of the first task run on that worker, it doesn't get updated as other tasks start. This is the wrong place to be passing in that value.
Cheers,
Richard