Bug 8805

Summary: Detect and warn people naming functions something_remove_something
Product: [Build System, Metadata & Runtime] BitBake Reporter: Ross Burton <ross.burton>
Component: bitbakeAssignee: Chee Yang <chee.yang.lee>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: chee.yang.lee, joshuagloe, mostthingsweb, poky.bs.watcher, poky.watcher, randy.macleod
Version: 2.0   
Target Milestone: 3.3 M1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2015-12-14 16:08:12 UTC
If a recipe has a function that contains _remove the override handling kicks in and generally results in a terse failure at parse time:

ERROR: ExpansionError during parsing /home/ross/Yocto/poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb: Failure expanding variable xcb_remove_python: TypeError: 'NoneType' object is not iterable

It would be good if the system at least made the warning more usable, and ideally warned that attempting to name a function with _remove_ in (or _append_) is a bad idea.
Comment 1 Chris Laplante 2020-07-02 13:45:08 UTC
I'm unable to reproduce this. Maybe it's been fixed?
Comment 2 Chee Yang 2020-11-01 23:08:22 UTC
i got error by adding this task to recipe

addtask task_remove_test
do_task_remove_test() {
   # prevent blank task
   echo ${WORKDIR} >> ${WORKDIR}/test
}


same error for _append_ and _prepend_



Error:

  File "/data/4T/poky-master/bitbake/lib/bb/codeparser.py", line 343, in ShellParser.parse_shell(value=None):

    >        self._parse_shell(value)
             self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs)
  File "/data/4T/poky-master/bitbake/lib/bb/codeparser.py", line 354, in ShellParser._parse_shell(value=None):
             except Exception:
    >            bb.error('Error during parse shell code, the last 5 lines are:\n%s' % '\n'.join(value.split('\n')[-5:]))
                 raise
AttributeError: 'NoneType' object has no attribute 'split'