openwebos/meta-webos — pull request #54 by shr-project (2013-08-22 16:49:53+00:00)
Title: Decentralized BOM

```
Later this week we plan to merge a number of commits which will change how
component versions and submissions are specified in the Open webOS layer.

High-level overview:
A) The version and submission of a component will be specified in its recipe
instead of in the global webos-preferred-versions.inc file.
B) A new WEBOS_VERSION variable will replace the current unconventional use of
PREFERRED_VERSION. Its assignment should appear directly above the
assignment to PR.
C) WEBOS_VERSION must have a "_" appended when submission tags are
used. All tags should be now be annotated and should be the full
40-character SHA-1 hash of the annotated tag (not the hash of the last
change referenced in the tag). A new tool will be provided to help do this.
D) The definition of "enhanced submission" will be changed to be that the
submission portion of WEBOS_VERSION has "_" appended to the
submission number and the definition of a basic submission changed to be
that it doesn't have it appended to the submission number.
E) WEBOS_GIT_TAG will be replaced by two new variables: WEBOS_GIT_PARAM_TAG, to
which the tag= parameter of SRC_URI will be set, and WEBOS_GIT_REPO_TAG, the
name of the tag that appears in the Git repo.
F) Usages of PR_append will be replaced with EXTENDPRAUTO_append to allow other
distributions to use PR Service (see
https://wiki.yoctoproject.org/wiki/PR_Service).
G) PR and EXTENDPRAUTO_append bumps are not to be done if the only change is to
WEBOS_VERSION (or to comments). Also, they need not be done for changes to
the RDEPENDS_${PN} assignments in packagegroup recipes.

More details for each topic:
A) Having all of the components' version and submission values in a global file
means that there are often rebase/merge conflicts when there are multiple
independent changes to them "in play". Moving the version and submission to
the component recipe means these will no longer occur.
B) PREFERRED_VERSION is meant to be used to select the preferred version when
there are multiple recipes with different versions are available. Using it
together with webos_enhanced_submissions was preventing the of use this
functionality, because when some upstream layer provides, for example,
base-files_3.0.14.bb and there is base-files.bb with
webos_enhanced_submissions inherited, you cannot select the upstream one by
setting PREFERRED_VERSION_base-files = "3.0.14" because base-files.bb will
immediately set its PV also to "3.0.14". You can still change the version
you use without changing the recipe by setting:
WEBOS_VERSION = "1.0.0-2_e3b8585738abea96a9fd1d1204731004a35e0bc9"
in a .bbappend in your layer or in its distro config and you can override it
again if needed (e.g. to test different version) from webos-local.conf:
WEBOS_VERSION_pn-foo_forcevariable = \
"1.0.0-3_288bbda31164efffd07a370a728a7682db775c08"
C) The bitbake Git fetcher needs to use "git ls-remote" to map changeable Git
tags to immutable SHA-1 hashes order to ensure that all builders are using
the exact same source when the same tag is defined in recipes. Imagine this
scenario:
1) Builder A builds some component with tag submission/1 which corresponds
to revision 'abcd123456' at the time when do_fetch was executed.
2) Someone changes tag submission/1 to revision 'ef12345678'.
3) Builder B builds the same component with the same tag submission/1 but
this time using revision 'ef12345678', producing packages with different
content but with the same name than builder A.
4) Builder A is running build again -> git ls-remote will discover
that submission/1 isn't 'abcd123456' anymore, so it will execute
do_fetch task again, download and build revision 'ef12345678'.
D) A consequence of this and C) is that the recipes for all webOS components
that are housed in Git repos will be required to inherit from
webos_enhanced_submissions and only those that do not will be able to
inherit from webos_submissions.
E) WEBOS_GIT_PARAM_TAG and WEBOS_GIT_REPO_TAG will be defined by
webos_enhanced_submissions.bbclass, although recipes can override
WEBOS_GIT_REPO_TAG if their components' tags do not follow the webOS
standard 'submissions/' scheme.
F) If PR service is enabled, this means that package names will change from:
base-files_3.0.14-r73webos1_qemuarm.ipk
to
base-files_3.0.14-r73.8webos1_qemuarm.ipk
where
'r73' is the PR set in the base-files recipe
'.8' is the increasing number from PR Service
'webos1' is appended by the .bbappend in the meta-webos layer
If PR Service is not enabled, the package names will be unchanged.
G) The reason for the exception for packagegroup recipes is to reduce the
conflicts when merging changes that add or remove packages from the images.
Having PR change when this happens is not necessary.
```