Bug 12356

Summary: devtool search produces tracebacks and not returning the search results
Product: [Yocto Project Subprojects] eSDK Reporter: Rebecca Chang <rebecca.swee.fun.chang>
Component: eSDKAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: normal    
Priority: Medium+ CC: rebecca.swee.fun.chang
Version: 2.4   
Target Milestone: 2.5 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Rebecca Chang 2017-11-16 00:28:52 UTC
Using the eSDK installer from 2.4 release, I have also tried to use search subcommands.

eSDK installer used in this example: http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.4.sh 

When running ‘devtool search libGL’ , it returned some tracebacks and not returning the search results.

----- snip -----

$ devtool search libGL
NOTE: Starting bitbake server...
Loading cache: 100% |##############################################################################################################| Time: 0:00:00
Loaded 1275 entries from dependency cache.
Traceback (most recent call last):
  File "/media/rebeccas/yocto/poky_sdk_64/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 331, in <module>
    ret = main()
  File "/media/rebeccas/yocto/poky_sdk_64/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 318, in main
    ret = args.func(args, config, basepath, workspace)
  File "/media/rebeccas/yocto/poky_sdk_64/layers/build/scripts/lib/devtool/search.py", line 39, in search
    for fn in os.listdir(pkgdata_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/media/rebeccas/yocto/poky_sdk_64/tmp/pkgdata/qemux86-64'

----- snip -----
Comment 1 Rebecca Chang 2017-11-16 06:04:30 UTC
Some extra checking on 'devtool search' outside of eSDK environment. Same failure found.

$ cd poky
$ source oe-init-build-env
$ devtool search libGL

NOTE: Starting bitbake server...
Parsing recipes: 100% |##########################################| Time: 0:00:05
Parsing of 816 .bb files complete (0 cached, 816 parsed). 1273 targets, 43 skipped, 0 masked, 0 errors.
Traceback (most recent call last):
  File "/media/rebeccas/yocto/poky/scripts/devtool", line 342, in <module>
    ret = main()
  File "/media/rebeccas/yocto/poky/scripts/devtool", line 329, in main
    ret = args.func(args, config, basepath, workspace)
  File "/media/rebeccas/yocto/poky/scripts/lib/devtool/search.py", line 39, in search
    for fn in os.listdir(pkgdata_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/media/rebeccas/yocto/poky/build/tmp/pkgdata/qemux86'
Comment 2 Paul Eggleton 2018-03-06 11:50:54 UTC
I have now fixed this in master (for 2.5) - not only do we avoid the traceback, but we also now search the recipe cache as well in case the item being searched for has not been built:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e8c7c36c60da20df4e261f27b1606f8e2aa2e441