Bug 12096 - Tinfoil doesn't behave well if environment not initialised
Summary: Tinfoil doesn't behave well if environment not initialised
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.4
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 4.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-09-17 22:31 UTC by Paul Eggleton
Modified: 2021-02-16 12:22 UTC (History)
5 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 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.