Bug 12096

Summary: Tinfoil doesn't behave well if environment not initialised
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: dorindabassey, poky.bs.watcher, poky.watcher, richard.purdie, tim.orling
Version: 2.4   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2017-09-17 22:31:30 UTC
If you run a tinfoil-using script without running oe-init-build-env (or similar) then it hangs for 30s and then gives a traceback:

----------------- snip -----------------
$ scripts/oe-pkgdata-util list-pkgs
ERROR: Unable to connect to bitbake server, or start one
Traceback (most recent call last):
  File "scripts/oe-pkgdata-util", line 598, in <module>
    main()
  File "scripts/oe-pkgdata-util", line 578, in main
    tinfoil = tinfoil_init()
  File "scripts/oe-pkgdata-util", line 44, in tinfoil_init
    tinfoil.prepare(True)
  File "/home/paul/poky/poky/bitbake/lib/bb/tinfoil.py", line 397, in prepare
    extrafeatures)
  File "/home/paul/poky/poky/bitbake/lib/bb/main.py", line 473, in setup_bitbake
    bb.fatal("Unable to connect to bitbake server, or start one")
  File "/home/paul/poky/poky/bitbake/lib/bb/__init__.py", line 104, in fatal
    raise BBHandledException()
bb.BBHandledException
ERROR: Unable to connect to bitbake server, or start one
ERROR: Unable to connect to bitbake server, or start one
----------------- snip -----------------

Scripts such as devtool have their own checks for this that error out immediately, but it seems to me that tinfoil ought to handle this properly itself rather than every script having to have boilerplate checking code.