I have just downloaded a fresh copy of bitbake and I've been going through this tutorial: http://a4z.bitbucket.org/docs/BitBake/guide.html#_exploring_recipes_and_tasks. When I try to list the tasks using: bitbake -c listtasks second I get the following error: radu@testy:~/work/bbtutorial/build$ bitbake -c listtasks second Parsing recipes: 100% |####################################################################################################################| Time: 00:00:00 Parsing of 2 .bb files complete (0 cached, 2 parsed). 2 targets, 0 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies NOTE: Preparing RunQueue NOTE: Executing RunQueue Tasks ERROR: second-1.0-r1 do_listtasks: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_listtasks(d) 0003: File: '/home/radu/work/bbtutorial/build/../meta-tutorial/classes/base.bbclass', lineno: 55, function: do_listtasks 0051:do_listtasks[nostamp] = "1" 0052:python do_listtasks() { 0053: import sys 0054: for e in bb.data.keys(d): *** 0055: if d.getVarFlag(e, 'task'): 0056: bb.plain("%s" % e) 0057:} 0058: 0059:addtask build Exception: TypeError: getVarFlag() takes at least 4 arguments (3 given) ERROR: second-1.0-r1 do_listtasks: Function failed: do_listtasks ERROR: Logfile of failure stored in: /home/radu/work/bbtutorial/build/tmp/work/second-1.0-r1/temp/log.do_listtasks.3349 ERROR: Task 0 (/home/radu/work/bbtutorial/build/../meta-tutorial/recipes-tutorial/second/second_1.0.bb, do_listtasks) failed with exit code '1' NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and 1 failed. Summary: 1 task failed: /home/radu/work/bbtutorial/build/../meta-tutorial/recipes-tutorial/second/second_1.0.bb, do_listtasks Summary: There were 2 ERROR messages shown, returning a non-zero exit code. If I modify the the function do_listtasks() from base.class to: ... if d.getVarFlag(e, 'task', False): ... it works perfectly. PS: - the same problem/solution is for the "showdata()" function - I am running ubuntu in a virtual machine - I was at chapter 6.3 in the tutorial when this happened (so that you might recreate my project)
Since earlier this year getVarFlag() requires the expand parameter to be present (this is in preparation for future when expand will default to True). So this is not a bug in bitbake or yocto but an API change. I'm not closing the bug yet since it seems the documentation is not up-to-date yet (e.g. https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#accessing-datastore-variables-using-python). I'll send the tutorial author an email, maybe he wants to fix that as well.
The comment is not only in the documentation but also in the default base.bbclass provided by bitbake. Problems are at line 46 and line 55. Here the old API is used.
I assume you mean this base.bbclass: > home/radu/work/bbtutorial/build/../meta-tutorial/classes/base.bbclass This file seems to be part of the tutorial you are using, not bitbake or oe-core.
The base.bbclass is located in <bitbake-path>/classes that comes with the standard bitbake I cloned from the github repository. The tutorial pointed out that I should use it which I did.
(In reply to comment #4) > The base.bbclass is located in <bitbake-path>/classes that comes with the > standard bitbake I cloned from the github repository. > > The tutorial pointed out that I should use it which I did. Ah, you copied the example class to the tutorial directory and that one is not updated. Got it, sorry for my slowness (it is monday). Updating title.
No problem.
http://git.openembedded.org/bitbake/commit/?id=d830dccf948d188492cecfcf2ff053f31740dc21