Bug 11719 - Unneeded stack trace is printed when ruunqemu fails
Summary: Unneeded stack trace is printed when ruunqemu fails
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4
Assignee: Ed Bartosh
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-06-26 14:50 UTC by Humberto Ibarra
Modified: 2017-07-24 08:17 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Humberto Ibarra 2017-06-26 14:50:52 UTC
Stack trace is being printed when runqemu fails, and it shouldn't. Here are two cases I found:

1) Built core-image-minimal for qemux86, then issued "runqemu qemuarm"

[humberto@localhost build]$ runqemu qemuarm
runqemu - INFO - Assuming MACHINE = qemuarm
runqemu - INFO - Running MACHINE=qemuarm bitbake -e...
runqemu - ERROR - /home/humberto/poky/build/tmp/deploy/images/qemuarm not a directory valid DEPLOY_DIR_IMAGE
runqemu - INFO - Running ls -t /home/humberto/poky/build/tmp/deploy/images/qemuarm/*.qemuboot.conf...
ls: cannot access '/home/humberto/poky/build/tmp/deploy/images/qemuarm/*.qemuboot.conf': No such file or directory
runqemu - INFO - Overriding conf file setting of STAGING_DIR_NATIVE to /home/humberto/poky/build/tmp/work/armv5e-poky-linux-gnueabi/defaultpkgname/1.0-r0/recipe-sysroot-native from Bitbake environment
Traceback (most recent call last):
  File "/home/humberto/poky/scripts/runqemu", line 1239, in <module>
    ret = main()
  File "/home/humberto/poky/scripts/runqemu", line 1226, in main
    config.check_and_set()
  File "/home/humberto/poky/scripts/runqemu", line 647, in check_and_set
    self.check_fstype()
  File "/home/humberto/poky/scripts/runqemu", line 508, in check_fstype
    raise Exception("FSTYPE is NULL!")
Exception: FSTYPE is NULL!

IMO, the issue is clear once the error is displayed, everything that comes after the ERROR is unneeded and not helpful. Maybe the error message could be improved, but either way I think the later part should be removed and leave it at:

[humberto@localhost build]$ runqemu qemuarm
runqemu - INFO - Assuming MACHINE = qemuarm
runqemu - INFO - Running MACHINE=qemuarm bitbake -e...
runqemu - ERROR - /home/humberto/poky/build/tmp/deploy/images/qemuarm not a directory valid DEPLOY_DIR_IMAGE


2) I run "runqemu qemux86 core-image-sato", which is wrong since I only built core-image-minimal. however the message is also sending a useless stack trace to the user:

[humberto@localhost build]$ runqemu qemux86 core-image-sato
runqemu - INFO - Assuming MACHINE = qemux86
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - MACHINE: qemux86
runqemu - INFO - DEPLOY_DIR_IMAGE: /home/humberto/poky/build/tmp/deploy/images/qemux86
Traceback (most recent call last):
  File "/home/humberto/poky/scripts/runqemu", line 1239, in <module>
    ret = main()
  File "/home/humberto/poky/scripts/runqemu", line 1225, in main
    config.read_qemuboot()
  File "/home/humberto/poky/scripts/runqemu", line 692, in read_qemuboot
    raise Exception("Failed to find %s (wrong image name or BSP does not support running under qemu?)." % self.qemuboot)
Exception: Failed to find /home/humberto/poky/build/tmp/deploy/images/qemux86/core-image-sato-qemux86.qemuboot.conf (wrong image name or BSP does not support running under qemu?).

Could we just drop the stack trace and leave this at:

[humberto@localhost build]$ runqemu qemux86 core-image-sato
runqemu - INFO - Assuming MACHINE = qemux86
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - MACHINE: qemux86
runqemu - INFO - DEPLOY_DIR_IMAGE: /home/humberto/poky/build/tmp/deploy/images/qemux86
Failed to find /home/humberto/poky/build/tmp/deploy/images/qemux86/core-image-sato-qemux86.qemuboot.conf (wrong image name or BSP does not support running under qemu?).


Both issues just require to show a simple, easy-to-understand message. Stack traces should be dropped and message clarity improved, if possible.
Comment 1 Ed Bartosh 2017-07-11 14:48:33 UTC
please, review the fix: http://lists.openembedded.org/pipermail/openembedded-core/2017-July/139389.html
Comment 2 Ed Bartosh 2017-07-24 08:17:39 UTC
The fix has been merged to poky master. Commit id 1b11a653d0be6128b26ea9421c783c6e78f7549b