Bug 7985

Summary: Variable typing support within BitBake
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: david.reyna, joshuagloe, kergoth, poky.bs.watcher, poky.watcher, randy.macleod, sgw
Version: 1.8   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 7596    

Description Paul Eggleton 2015-07-10 09:29:49 UTC
In various different places in the system we encounter situations where it would be useful to have the type of a variable defined; examples include:

1) Toaster project configuration (see bug 7596), or potentially any other UI that wants to validate or provide suggestions for user variable values

2) buildhistory (in meta/lib/oe/buildhistory_analysis.py) currently hard-codes which of the variables that it wants to output that are lists, numbers, etc. so that it knows how to compare their values. It would be much better if this were defined in a more appropriate place.

3) If we knew a variable was a space-separated feature list, we could potentially have the signature generation code squash spaces and sort/de-duplicate the list prior to incorporating the value into the signature. This could potentially be done in the datastore itself.

4) The _remove operator - currently we just assume the variable is space-separated and that covers almost all use cases, but some variables separate items differently (e.g. path variables). A less compelling case than the others perhaps but still possibly worth considering.

5) We validate the values added to IMAGE_FEATURES in meta/classes/image.bbclass using a "validitems" varflag, but the implementation is only within that class. We could potentially have this as an optional part of the typing support.

We do have some basic typing support in OE rather than BitBake, i.e. meta/classes/typecheck.bbclass and meta/lib/oe/types.py, however it's not widely used and wouldn't work for all of these use cases.
Comment 1 Michael Halstead 2015-08-12 16:00:23 UTC
Clearing 2.0 milestone
Comment 2 David Reyna 2018-08-15 09:07:52 UTC
I will note that both "Toaster" and "buildhistory_analysis.py" are under active development.

While the investment to resolve this case may not be viable, and may itself introduce brittleness, I believe that it is still good to track it.