Bug 13562

Summary: When using bitbake prior to 1.43.1 we get an error rather than "bitbake too old"
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Tom Rini <tom.rini>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: High CC: akuster, meta.mr.watcher, meta.watcher, richard.purdie
Version: unspecified   
Target Milestone: 2.8 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Tom Rini 2019-09-28 17:17:17 UTC
When using current oe-core master and a version of bitbake older than BB_MIN_VERSION rather than getting the intended "bitbake is too old, please upgrade" type of message we get a parse error that starts with:
ERROR: Unable to parse Var <OE_IMPORTED[:=]>
Comment 1 Armin Kuster 2019-09-29 16:31:45 UTC
I ran into a similar issue on system that had an old version of master sources for oe-core and bitbake.  I did a pull and then ran bitake core-image-minimal

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/build/builds/master/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 2288 at 2019-09-29 15:40:58.186803 ---
ERROR: Unable to parse Var <OE_IMPORTED[:=]>
Traceback (most recent call last):
  File "Var <OE_IMPORTED[:=]>", line 1, in <module>
  File "/home/build/releases/master/poky/meta/classes/base.bbclass", line 33, in oe_import(d=<bb.data_smart.DataSmart object at 0x7f02df1c9278>):
         for toimport in oe.data.typed_value("OE_IMPORTS", d):
    >        imported = __import__(toimport)
             inject(toimport.split(".", 1)[0], imported)
  File "/home/build/releases/master/poky/meta/lib/oe/utils.py", line 489, in <module>:
     
    >class ImageQAFailed(bb.build.FuncFailed):
         def __init__(self, description, name=None, logfile=None):
bb.data_smart.ExpansionError: Failure expanding variable OE_IMPORTED[:=], expression was ${@oe_import(d)} which triggered exception AttributeError: module 'bb.build' has no attribute 'FuncFailed'
Comment 2 Richard Purdie 2019-09-30 15:58:19 UTC
This looks to be caused by the removal of bb.build.FuncFailed. We may need to add an exception handler and better error for this specifically.
Comment 3 Armin Kuster 2019-10-01 15:40:38 UTC
let me see if I can find a way to reproduce this.
Comment 4 Armin Kuster 2019-10-01 15:51:39 UTC
Ok, if I checkout bitbake 1.42 top of branch 164c0df429fc9be771c54c241b17d7afb8849afc

and use a current oe-core I get this trace back.

 bitbake core-image-minimal
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/build/releases/master/openembedded-core/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 18705 at 2019-10-01 15:47:58.181849 ---
ERROR: Unable to parse Var <OE_IMPORTED[:=]>
Traceback (most recent call last):
  File "Var <OE_IMPORTED[:=]>", line 1, in <module>
  File "/home/build/releases/master/openembedded-core/meta/classes/base.bbclass", line 35, in oe_import(d=<bb.data_smart.DataSmart object at 0x7fbdd90914a8>):
         for toimport in oe.data.typed_value("OE_IMPORTS", d):
    >        imported = __import__(toimport)
             inject(toimport.split(".", 1)[0], imported)
  File "/home/build/releases/master/openembedded-core/meta/lib/oe/sstatesig.py", line 260, in <module>:
     
    >class SignatureGeneratorOEEquivHash(bb.siggen.SignatureGeneratorUniHashMixIn, SignatureGeneratorOEBasicHash):
         name = "OEEquivHash"
bb.data_smart.ExpansionError: Failure expanding variable OE_IMPORTED[:=], expression was ${@oe_import(d)} which triggered exception AttributeError: module 'bb.siggen' has no attribute 'SignatureGeneratorUniHashMixIn'
Comment 5 Armin Kuster 2019-10-01 15:55:06 UTC
bitbake checked out @ 	cfeffb602dd5319f071cd6bcf84139ec77f2d170
build/utils: Drop bb.build.FuncFailed

I see what Tom is expecting
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Bitbake version 1.43.1 is required and version 1.43.0 was found
Comment 6 Richard Purdie 2019-10-02 08:59:21 UTC
Ok, so the problem isn't bb.build.FuncFailed but is the unihash mixin changes. That helps.
Comment 7 Richard Purdie 2019-10-02 14:15:18 UTC
Patches out to allow the version test to trigger and add a new version for this.
Comment 9 Tom Rini 2019-10-02 19:33:38 UTC
Verified expected output myself now, moving to closed.
Comment 10 Armin Kuster 2019-10-02 19:43:16 UTC
thanks