Bug 7985 - Variable typing support within BitBake
Summary: Variable typing support within BitBake
Status: NEW
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: Future
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 7596
  Show dependency tree
 
Reported: 2015-07-10 09:29 UTC by Paul Eggleton
Modified: 2026-08-27 14:59 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.