Bug 1229

Summary: bitbake-runtask doesn't work in both 1.0.1 and 1.1
Product: [Build System, Metadata & Runtime] BitBake Reporter: Robert Yang <liezhi.yang>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: liang.li2, liangliang.wang, poky.bs.watcher, poky.watcher, richard.purdie, sgw, yi.zhao
Version: 1.2   
Target Milestone: 1.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Robert Yang 2011-07-07 20:25:56 UTC
There is the following code in bitbake/bin/bitbake-runtask:

cooker.bb_cache.setData(fn, buildfile, the_data)
cooker.bb_cache.handle_data(fn, cooker.status)

The API setData has been removed in 1.0.1 and 1.1, so it doesn't work, I think that replace them by:

cooker.bb_cache.handle_data(fn, cooker.status) 

would make it work.
Comment 1 Richard Purdie 2011-10-31 03:48:10 UTC
This is not an enhancement request, bitbake-runtask exists and its broken. That is a bug.
Comment 3 liang li 2011-12-01 00:50:12 UTC
verified on following git commit :
commit 4cd96710785eb05abeff1f281878655118d4a7dd
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Fri Nov 25 14:57:53 2011 +0000

    bitbake: Update users of getVar/setVar to use the data store functions direc
   
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 
git branch: poky/master

test steps:
1.set build env.
2.run "bitbake man-1.6f".
3.run "bitbake man-1.6f -cclean".
4.run "bitbake-runtask man_1.6f do_fetch" .
also run "bitbake-runtask man_1.6f do_unpack","bitbake-runtask man_1.6f do_patch","bitbake-runtask man_1.6f do_configure","bitbake-runtask man_1.6f 
do_compile","bitbake-runtask man_1.6f do_install","bitbake-runtask man_1.6f do_populate_lic","bitbake-runtask man_1.6f do_populate_sysroot"
5.check return value of these command using "echo $?",all get 0.
6.check related logs in tmp/work/ppc603e-poky-linux/man-1.6f-r1/temp (qemuppc for example)

test following platforms:
qemux86,qemux86-64,qemuppc,qemumips,qemuarm,mpc8315e-rdb

no error met execute bitbake-runtask,so change status to verified.
Comment 4 liang li 2012-03-05 04:01:18 UTC
bitbake-runtask can not work on 1.2 M3 RC1:
git info : 320558f494c618f53e0c773db3ea0109476e8359
git branch : 1.2_M3

test steps just as Comment 3:
when run "bitbake-runtask man_1.6f do_fetch" ,errors below found:
ERROR: Build of do_fetch failed
ERROR: Traceback (most recent call last):
  File "/buildarea1/tester/test_git/bitbake/lib/bb/build.py", line 386, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/buildarea1/tester/test_git/bitbake/lib/bb/build.py", line 376, in _exec_task
    make_stamp(task, localdata)
  File "/buildarea1/tester/test_git/bitbake/lib/bb/build.py", line 431, in make_stamp
    stamp = stamp_internal(task, d, file_name)
  File "/buildarea1/tester/test_git/bitbake/lib/bb/build.py", line 420, in stamp_internal
    stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
  File "/buildarea1/tester/test_git/bitbake/lib/bb/siggen.py", line 222, in stampfile
    h = self.taskhash[k]
KeyError: '/buildarea1/tester/test_git/meta/recipes-extended/man/man_1.6f.bb.do_fetch'

when change "do_fecth" to others such as "do_unpack", same error as above.
Comment 5 Richard Purdie 2012-03-07 20:28:50 UTC
Whilst the error is pretty nasty, if you set BB_SIGNATURE_HANDLER = 'OEBasic', the error will not happen.

The problem is the default handler, OEBasicHash is not going to be compatible with the bitbake-runtask mechanism of running tasks since there is no task signature data to use with the stamp. I'm therefore not sure this is an error we can fix, it just needs to be documented as something that is not expected to work.
Comment 6 liang li 2012-03-08 03:58:15 UTC
(In reply to comment #5)
> Whilst the error is pretty nasty, if you set BB_SIGNATURE_HANDLER = 'OEBasic',
> the error will not happen.
> 
> The problem is the default handler, OEBasicHash is not going to be compatible
> with the bitbake-runtask mechanism of running tasks since there is no task
> signature data to use with the stamp. I'm therefore not sure this is an error
> we can fix, it just needs to be documented as something that is not expected to
> work.

Thanks your advice, I have tried that :
change following part of file "meta-yocto/conf/distro/poky.conf": 
# Default hash policy for distro
BB_SIGNATURE_HANDLER ?= 'OEBasicHash'
to :
# Default hash policy for distro
BB_SIGNATURE_HANDLER ?= 'OEBasic'

then rerun steps in Comment 3,bitbake-runtask can work.
Comment 7 Saul Wold 2012-03-08 17:37:21 UTC
This needs to have a reasonable error message vs the Python backtrace
Comment 9 liang li 2012-03-12 07:55:10 UTC
bitbake-runtask can work using steps in Comment 3:
git info:fe0659991b826eb3b4163743d29533fe5f91cb12
git branch: poky/master

next weekly test if no error met, will change to verified.