Bug 7006 - classes containing a dash in the name cannot use "EXPORT_FUNCTIONS"
Summary: classes containing a dash in the name cannot use "EXPORT_FUNCTIONS"
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.8 M2
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-12-02 11:03 UTC by Diego
Modified: 2015-01-08 10:40 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego 2014-12-02 11:03:10 UTC
Using EXPORT_FUNCTIONS, as described here:
http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#flexible-inheritance-for-class-functions
works only when the class has no dashes in the name.

While classes with a dash in the name are valid (there are plenty in oe-core/poky itself), they cause error when using EXPORT_FUNCTIONS.

How to reproduce:

1) define the following "dashed-class.bbclass":
dashed-class_do_custom_function() {
        # do nothing
}

EXPORT_FUNCTIONS do_custom_function

2) use do_custom_function inside a recipe

Bitbaking will result in the following error:
dashed-class_do_custom_function: not found


Renaming the class to "nondashedclass.bbclass" and fixing the function definition accordingly doesn't cause the problem, so my guess is that dashed are not parsed properly in functions definition.
Comment 1 Richard Purdie 2015-01-08 10:40:14 UTC
dash characters are illegal in sh function names. There isn't anything we can do about that (and we don't want to mandate bash, we can't due to our sh parser anyway) so I've made sure you get a clear early error at parse time from bitbake instead explaining the problem:

http://git.yoctoproject.org/cgit.cgi/poky/patch/?id=2e26745a134373dfde3aa2b16fef3df720436e77