Bug 7829 - Bitbake shouldn't complain about empty method
Summary: Bitbake shouldn't complain about empty method
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.9
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9
Assignee: Richard Purdie
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-05-31 21:29 UTC by Igor Stoppa
Modified: 2016-02-22 08:26 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Stoppa 2015-05-31 21:29:32 UTC
Sometimes one might want to override a default method.
For example, I wanted to prevent the execution of the real do_build, so I created an empty one:

python do_build () {
}

This apparently simple trick didn't work, I got the error: 
" ... Failure expanding variable do_build: IndexError: string index out of range"


changing the method to:

python do_build () {
# gibberish
}

did the trick.

The limitation imposed seems unnecessary.

Btw, I still didn't get any line number for the error, which tends to be annoying.
Comment 2 Daniel Istrate 2016-02-16 09:02:30 UTC
Verified on master: 36b43b233c841b3c09fc17e04686b4b758780963

Steps:

1. git checkout 43c6e8c0dd7a7139b476b94d69a0252c639393bf
2. Create meta-selftest/recipes-test/ed/ed_1.9.bbappend and add
python do_build () {
}
3. bitbake ed -->
NOTE: Error during finalise of /home/daniel/poky/meta/recipes-extended/ed/ed_1.9.bb                                      | ETA:  00:00:18
ERROR: ExpansionError during parsing /home/daniel/poky/meta/recipes-extended/ed/ed_1.9.bb: Failure expanding variable do_build: IndexError: string index out of range
4. git checkout master
5. bitbake ed --> build successfully