Bug 9909 - Suggested clarification re. implementation and limitations of BBCLASSEXTEND
Summary: Suggested clarification re. implementation and limitations of BBCLASSEXTEND
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.2 M3
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 16 July 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-07-12 00:33 UTC by ulfalizer
Modified: 2016-07-16 18:54 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-07-12 00:33:34 UTC
BBCLASSEXTEND and its limitations are easier to understand when you have some idea of how it is implemented (going on personal experience). I suggest adding the following as a note to the glossary entries for BBCLASSEXTEND in the Yocto Project Reference Manual and in the BitBake User Manual. BBCLASSEXTEND appears in both glossaries.


"Internally, the BBCLASSEXTEND mechanism generates recipe variants by rewriting
variable values and applying overrides such as _class-native. For example, to
generate a native version of a recipe, a DEPENDS on foo is rewritten to a
DEPENDS on foo-native.

No reparsing of the recipe is done for each variant, which adds some
limitations. For example, it is not possible to 'include' a different file
depending on the variant, since 'include's are processed when the recipe is
parsed."
Comment 1 Scott Rifenbark 2016-07-12 21:11:20 UTC
Hi, 

Check out both variables here for the additional Note:

 * http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-BBCLASSEXTEND

 * http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#var-BBCLASSEXTEND

Let me know.

Thanks, 
Scott
Comment 2 ulfalizer 2016-07-13 01:44:43 UTC
This makes it sound like it's the reparsing and not the lack of it that adds limitations:

"No reparsing, which adds some limitations, of the recipe is done for each variant. For example, it is not possible to "include" a different file depending on the variant, since "include's" are processed when the recipe is parsed."

How about this? Should be clearer than the original version.

"Even when using BBCLASSEXTEND, the recipe is only parsed once. This adds some limitations. For example, it is not possible to "include" a different file depending on the variant, since "include's" are processed when the recipe is parsed."

Also, I'd use code highlighting for "include"/"include's" and remove the quotation marks.
Comment 3 ulfalizer 2016-07-14 03:19:31 UTC
Saw one more thing:

  For example, to generate a native version of a recipe named "foo", a DEPENDS on "foo" is rewritten...

should be

  For example, to generate a native version of a recipe, a DEPENDS on "foo" is rewritten...

"foo" is just the dependency, not the name of the recipe itself.
Comment 4 Scott Rifenbark 2016-07-14 19:55:13 UTC
Ulf, 

Here are the links....

 * http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-BBCLASSEXTEND

 * http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#var-BBCLASSEXTEND

Identical changes in both manuals.  Let me know. 

Thanks, 
Scott
Comment 5 ulfalizer 2016-07-15 05:57:49 UTC
Looks good to me. Thanks!
Comment 6 Scott Rifenbark 2016-07-16 18:54:46 UTC
Thanks!

I have changed the status to resolved and set the doc flag to "Done."

Scott