diff options
| author | Chris Laplante <chris.laplante@agilent.com> | 2020-08-14 16:55:57 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-15 11:44:20 +0100 |
| commit | 0e15931688322f9422c4f128965f050b6e030c29 (patch) | |
| tree | 28d9f414604fb6738c05dc52eaa63579ab87309e /bitbake/lib/bb/process.py | |
| parent | b1cd7723c4d81081c6d1935be7373c7f06ae1b97 (diff) | |
| download | poky-0e15931688322f9422c4f128965f050b6e030c29.tar.gz | |
bitbake: build: print a backtrace with the original metadata locations of Bash shell funcs
Leverage the comments that emit_var writes and the backtrace that
the shell func writes to generate an additional metadata-relative
backtrace. This will help the user troubleshoot shell funcs much
more easily.
Example:
| WARNING: /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955:171 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
| #1: myclass_do_something, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 171
| #2: do_something, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 166
| #3: actually_fail, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 153
| #4: my_compile_extra, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 155
| #5: do_compile, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 141
| #6: main, /home/laplante/repos/oe-core/build/tmp-glibc/work/core2-64-oe-linux/libsolv/0.7.14-r0/temp/run.do_compile.68955, line 184
|
| Backtrace (metadata-relative locations):
| #1: myclass_do_something, /home/laplante/repos/oe-core/meta/classes/myclass.bbclass, line 2
| #2: do_something, autogenerated, line 2
| #3: actually_fail, /home/laplante/repos/oe-core/meta/recipes-extended/libsolv/libsolv_0.7.14.bb, line 36
| #4: my_compile_extra, /home/laplante/repos/oe-core/meta/recipes-extended/libsolv/libsolv_0.7.14.bb, line 38
| #5: do_compile, autogenerated, line 3
ERROR: Task (/home/laplante/repos/oe-core/meta/recipes-extended/libsolv/libsolv_0.7.14.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 542 tasks of which 541 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/laplante/repos/oe-core/meta/recipes-extended/libsolv/libsolv_0.7.14.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
(Bitbake rev: ae1aa4ea79826c32b20e1e7abdf77a15b601c6f2)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/process.py')
| -rw-r--r-- | bitbake/lib/bb/process.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py index 2dc472a86f..f36c929d25 100644 --- a/bitbake/lib/bb/process.py +++ b/bitbake/lib/bb/process.py | |||
| @@ -41,6 +41,7 @@ class ExecutionError(CmdError): | |||
| 41 | self.exitcode = exitcode | 41 | self.exitcode = exitcode |
| 42 | self.stdout = stdout | 42 | self.stdout = stdout |
| 43 | self.stderr = stderr | 43 | self.stderr = stderr |
| 44 | self.extra_message = None | ||
| 44 | 45 | ||
| 45 | def __str__(self): | 46 | def __str__(self): |
| 46 | message = "" | 47 | message = "" |
| @@ -51,7 +52,7 @@ class ExecutionError(CmdError): | |||
| 51 | if message: | 52 | if message: |
| 52 | message = ":\n" + message | 53 | message = ":\n" + message |
| 53 | return (CmdError.__str__(self) + | 54 | return (CmdError.__str__(self) + |
| 54 | " with exit code %s" % self.exitcode + message) | 55 | " with exit code %s" % self.exitcode + message + (self.extra_message or "")) |
| 55 | 56 | ||
| 56 | class Popen(subprocess.Popen): | 57 | class Popen(subprocess.Popen): |
| 57 | defaults = { | 58 | defaults = { |
