From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>,
isar-users <isar-users@googlegroups.com>
Cc: Baurzhan Ismagulov <ibr@ilbers.de>
Subject: Re: Error logging broken with next?
Date: Wed, 25 May 2022 08:40:25 +0200 [thread overview]
Message-ID: <7a895c71-aacb-d780-ddd4-b2588623e484@siemens.com> (raw)
In-Reply-To: <c461092b-5c35-8bce-85ac-457e8df69eb4@ilbers.de>
On 25.05.22 07:30, Anton Mikanovich wrote:
> 24.05.2022 22:50, Anton Mikanovich wrote:
>> 24.05.2022 19:36, Jan Kiszka wrote:
>>> I'm afraid we are talking past each other. This is what I retried again:
>>> $ . oe-init-build-env build
>>>
>>> recipe.bb:
>>> LICENSE = ""
>>>
>>> test_fun() {
>>> echo "FAIL!"
>>> false
>>> }
>>>
>>> python do_test() {
>>> bb.build.exec_func("test_fun", d)
>>> }
>>> addtask test
>>>
>>> conf/local.conf:
>>> ...
>>>
>>> BBFILES += "recipe.bb"
>>>
>>>
>>> $ bitbake -c test recipe
>>> ...
>>> NOTE: No setscene tasks
>>> NOTE: Executing Tasks
>>> ERROR: recipe-1.0-r0 do_test:
>>> ExecutionError('/poky-build/tmp/work/core2-64-poky-linux/recipe/1.0-r0/temp/run.test_fun.260',
>>> 1, None, None)
>>> ERROR: Logfile of failure stored in:
>>> /poky-build/tmp/work/core2-64-poky-linux/recipe/1.0-r0/temp/log.do_test.260
>>>
>>> Log data follows:
>>> | DEBUG: Executing python function do_test
>>> | DEBUG: Executing shell function test_fun
>>> | FAIL!
>>> | WARNING: exit code 1 from a shell command.
>>> | DEBUG: Python function do_test finished
>>> ERROR: Task (recipe.bb:do_test) failed with exit code '1'
>>> NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be
>>> rerun and 1 failed.
>>>
>>> Summary: 1 task failed:
>>> recipe.bb:do_test
>>> Summary: There was 1 ERROR message, returning a non-zero exit code.
>>>
>>> All fine for me.
>>>
>>> Is this what you saw as well?
>> Hmm... no.
>> What Yocto/Bitbake version did you use?
>> I'm using Yocto 3.4 based on Bitbake 1.52.0 as the most similar to the
>> version we use in Isar (1.50.5).
>> And in Yocto 3.4 there is no log for that example.
>>> Now with Isar, using isar-init-build-env instead:
>>> ...
>>> NOTE: No setscene tasks
>>> NOTE: Executing Tasks
>>> ERROR: recipe-1.0-r0 do_test: Error executing a python function in
>>> exec_python_func() autogenerated:
>>>
>>> The stack trace of python calls that resulted in this
>>> exception/failure was:
>>> File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
>>> 0001:
>>> *** 0002:do_test(d)
>>> 0003:
>>> File: 'recipe.bb', lineno: 9, function: do_test
>>> File "recipe.bb", line 9, in do_test
>>> bb.build.exec_func("test_fun", d)
>>>
>>> File: '/isar/bitbake/lib/bb/build.py', lineno: 256, function: exec_func
>>> 0252: with bb.utils.fileslocked(lockfiles):
>>> 0253: if ispython:
>>> 0254: exec_func_python(func, d, runfile, cwd=adir)
>>> 0255: else:
>>> *** 0256: exec_func_shell(func, d, runfile, cwd=adir)
>>> 0257:
>>> 0258: try:
>>> 0259: curcwd = os.getcwd()
>>> 0260: except:
>>> File: '/isar/bitbake/lib/bb/build.py', lineno: 507, function:
>>> exec_func_shell
>>> 0503: with open(fifopath, 'r+b', buffering=0) as fifo:
>>> 0504: try:
>>> 0505: bb.debug(2, "Executing shell function %s" % func)
>>> 0506: with open(os.devnull, 'r+') as stdin, logfile:
>>> *** 0507: bb.process.run(cmd, shell=False,
>>> stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
>>> 0508: except bb.process.ExecutionError as exe:
>>> 0509: # Find the backtrace that the shell trap
>>> generated
>>> 0510: backtrace_marker_regex = re.compile(r"WARNING:
>>> Backtrace \(BB generated script\)")
>>> 0511: stdout_lines = (exe.stdout or "").split("\n")
>>> File: '/isar/bitbake/lib/bb/process.py', lineno: 186, function: run
>>> 0182:
>>> 0183: if pipe.returncode != 0:
>>> 0184: if log:
>>> 0185: # Don't duplicate the output in the exception
>>> if logging it
>>> *** 0186: raise ExecutionError(cmd, pipe.returncode,
>>> None, None)
>>> 0187: raise ExecutionError(cmd, pipe.returncode, stdout,
>>> stderr)
>>> 0188: return stdout, stderr
>>> Exception: bb.process.ExecutionError: Execution of
>>> '/isar-build/tmp/work/debian-bullseye-armhf/recipe/1.0-r0/temp/run.test_fun.1487'
>>> failed with exit code 1
>>>
>>> ERROR: Logfile of failure stored in:
>>> /isar-build/tmp/work/debian-bullseye-armhf/recipe/1.0-r0/temp/log.do_test.1487
>>>
>>> ERROR: Task (recipe.bb:do_test) failed with exit code '1'
>>> NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be
>>> rerun and 1 failed.
>>>
>>> Summary: 1 task failed:
>>> recipe.bb:do_test
>>> Summary: There was 1 ERROR message shown, returning a non-zero exit
>>> code.
>>>
>>>
>>> This is NOT what we want to have. And this is an Isar bug at this level.
>>>
>>> Jan
>>>
>>
> Ok, it looks like I've found it.
> Did you use Yocto/Bitbake which already include this commit?
> https://github.com/openembedded/bitbake/commit/23a6f11b089b14382c21d431edf34fa7224c66bf
>
>
> Tried to apply on Isar's Bitbake and it works like it should be (error
> log is printed).
> So we just need to update BItbake version to at least 1.52.3
>
Good catch! I was on poky master, and that included this fix.
1.52.x implies override syntax change, right? Then I would recommend to
temporarily fork bitbake here - or propose that commit for the 1.50.x
stable line if that is still maintained upstream.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
next prev parent reply other threads:[~2022-05-25 6:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 16:49 Jan Kiszka
2022-05-16 7:49 ` Baurzhan Ismagulov
2022-05-16 11:05 ` Jan Kiszka
2022-05-17 12:35 ` Anton Mikanovich
2022-05-17 13:42 ` Anton Mikanovich
2022-05-19 6:01 ` Jan Kiszka
2022-05-23 19:06 ` Jan Kiszka
2022-05-24 7:43 ` Anton Mikanovich
2022-05-24 14:23 ` Anton Mikanovich
2022-05-24 15:54 ` Jan Kiszka
2022-05-24 15:57 ` Jan Kiszka
2022-05-24 16:05 ` Anton Mikanovich
2022-05-24 16:07 ` Jan Kiszka
2022-05-24 16:14 ` Anton Mikanovich
2022-05-24 16:36 ` Jan Kiszka
2022-05-24 19:50 ` Anton Mikanovich
2022-05-25 5:30 ` Anton Mikanovich
2022-05-25 6:40 ` Jan Kiszka [this message]
2022-05-24 16:02 ` Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a895c71-aacb-d780-ddd4-b2588623e484@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=amikan@ilbers.de \
--cc=ibr@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox