Best Known Methods (BKMs) for Package Updating: Difference between revisions

From Yocto Project
Jump to navigationJump to search
(Created page with 'This page is used for capturing the Best Known Methods (BKMs) of package upgrading as we get reviewed and process more of the packages. ==Don't Retain older Versions== Unless t…')
 
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This page is used for capturing the Best Known Methods (BKMs) of package upgrading as we get reviewed and process more of the packages.
This page is used for capturing the Best Known Methods (BKMs) for package upgrading as we review and process more of the packages.


==Don't Retain older Versions==
== Don't retain older versions ==


Unless there is a specific need (which will probably occur for GPLv2, this has also happened in the past when platforms have known bugs in the latest version) don't retain older versions of the recipe files and patches.
Unless there is a specific need (for GPLv2, or where there are known serious bugs in the latest version) don't retain older versions of the recipe files and patches.


== Use git mv to rename recipe and patches ==
== Use git mv for version updates ==


From Josh:
Use "git mv" to rename the old file to the new version - this means that you don't have to consciously delete the old version later.
Generally the way I perform recipe upgrades is to use git mv to rename the old file to the new version, this means that you don't have to consciously delete the old version later (win 1) and that git tracks the rename and the differences with the old file, which doesn't happen with a delete and add (win 2).


The advantage of this is that you and any reviewers can more easily see what has changed with the updated version of the recipe.
== Remove PR when upgrading recipes ==


PR values are now expected to be managed by the PR server.


Nitin: Actually {git mv a b} is nothing but {mv a b; git rm a; git add b} And the file renames are detected by git automatically by looking at the file contents. Because of this git behavior, git shows some renames as renames and sometimes not. And I did not find a way to force git to understand renames. So if after "git mv" git is showing "file add & file remove", then don't get surprised, it's normal git operation.
== Do not merge .inc / .bb files ==


=== Reset PR to 0 (or add PR) when upgrading recipes ===
We do not want to merge the common ".inc" files and recipe (.bb) files together. This is the case even if the .bb only contains a require and a PR = "r0" line. Leaving the .inc file separate allows other layers to re-use the .inc file for older/newer versions.


This is a good visual reminder to bump in the future if needed.
== Style guidelines ==


== For upgrades it's ok to use OE for inspiration ==
See the [http://openembedded.org/wiki/Styleguide OpenEmbedded style guide].


When upgrading packages, do the git mv as above, and build if it breaks, it's OK to check the OE equivalent and grab new patch or configuration change, just don't grab the whole recipe.
== Patches ==


Be sure to add a credit to OE in your commit message when you do take a change like this.
Patches should contain information about where they came from and why they are required, as the project moves forward, we want to increase the quality of the data that is made available to the community. This can be done in the recipes and also in the patch files in order to understand why the patch exists and to help future maintainer to understand why it is required.


Review: [[Merging packages from OpenEmbedded]]
=== Patch Comments ===


== For new package grab OE version, but sanitize them ==
Patch comments should contain information about why the patch is required, who created the patch and when. If that information is not currently known, the the information about where the patch last came from (such as from OpenEmbedded) is very important to maintain in the patch header. Having a Signed-off-by: tag is good to acknowledge that someone looked at the patch and added the comments to ensure it is still valid and current.


Follow the recipe rules for Yocto when you take an OE recipe, be sure to clean all the OE'isms out
To recap, patches should contain:
* Why
* Date created
* Who created it
* Any upstream information
** link to upstream mailing list
** link to upstream bug tracking
** IRC info
* Signed-off-by:
** This is most important when importing the patch and not the original author


Again, give credit to OE in commit messages
=== Patch Upstreaming ===


Review: [[Merging packages from OpenEmbedded]]
In order to keep track of patches and ultimate reduce the number of patches that the Yocto Project maintains, we need to track the status of the patches that are created. As mentioned above, the patches should contain comments about why they are created, by whom and when, we also want to track if it's appropriate to get this particular patch into the upstream project. Since we want to track this information, we need a consistent tag and set of status that can be searched. Be sure to include any URL to bug tracking, mailing list or other reference material pertaining to the patch.


== Do NOT Merge .inc / .bb files ==
'''Upstream-Status:'''
:;Pending
:: No determination has been made yet or not yet submitted to upstream
:;Submitted
:: Submitted to upstream, waiting approval
:;Accepted
:: Accepted in upstream, expect it to be removed at next update, include expected version info
:;Backport
:: Backported from new upstream version, because we are at a fixed version, include upstream version info
:;Denied
:: Not accepted by upstream, include reason in patch
:;Inappropriate [reason]
:: The patch is not appropriate for upstream, include a brief reason on the same line enclosed with []
::: '''reason''' can be:
:::: native
:::: licensing
:::: configuration
:::: enable feature
:::: disable feature
:::: bugfix (add bug url here)
:::: embedded specific
:::: other (give details in comments)


This was a decision that slipped by me, and was not communicated well, we do not want to merge the common ".inc" files and recipe (.bb) files. This is the case even if the .bb only contains a require and a PR="r0" line.  This does not mean split everything at this point, but don't merge going forward.
All patches and diff files should include this information.


== White Space Management ==
== Recipe Metadata Updates ==


=== LICENSE Metadata ===


* Most variables such as SRC_URI should use spaces.
See [http://openembedded.org/wiki/Recipe_License_Fields Recipe License Fields] on the OE wiki.


* Shell functions should use tabs
== Distro Tracking Fields ==


* Python functions should use spaces (4 spaces per indent).
The meta/conf/distro/include/*.inc files exist to allow us to track various pieces of information about recipes and upstream versions (e.g, recipe maintainer contact information, date of latest upstream release, alternate names used for this recipe in other Linux distros, etc). The following defines the meaning of each field:


== Commenting in Patches ==
;RECIPE_COLOR
: Indicates whether the recipe has been reviewed for basic quality control information (e.g, has had its software license verified). "red" indicates these checks have not been done, and "green" indicates that they have been done.
;RECIPE_UPSTREAM_VERSION
: The latest upstream stable version
;RECIPE_UPSTREAM_DATE
: The date at which the latest upstream stable version (mentioned in RECIPE_UPSTREAM_VERSION) was released, "Mar 3, 2013"
;RECIPE_MAINTAINER
: Name and email address of the person maintaining the recipe, "Firstname Lastname <email.address>"
;RECIPE_NO_UPDATE_REASON
: Reason for not updating the recipe to a later version if applicable
;DISTRO_PN_ALIAS
: A list mapping package names for tracking status of package relative to major distributions such as Fedora, Ubuntu, Debian


When you change or add patches, be sure to include attributions of where the patch came from, along with your full name and email similar to "Signed-off-by", no special tag is needed (yet?), but having your full name and email is important to track it.
Note that in the files, each field name is appended with _pn-<recipe name>.
 
== New style patch application ==
 
The patch and pnum parameters have been renamed to the more logical apply and striplevel. The apply parameter takes either "yes" or "no" and the striplevel parameter takes an integer (0, 1, etc).
 
Both parameters are now optional with "sane" defaults.
 
The apply parameter is optional for SRC_URI lines with patch or diff extensions, which will default to being applied.
 
The striplevel parameter is also optional with a default striplevel of 1.
 
Old style parameters (patch and pnum) will continue to work for some time but it would be useful to move to the new style syntax as people are updating other parts of their recipes.
 
Therefore a patch line would be changed from:
 
file://some.patch;patch=1;pnum=2
 
to:
 
file://some.patch;striplevel=2
 
and a patch line:

Latest revision as of 13:16, 10 June 2014

This page is used for capturing the Best Known Methods (BKMs) for package upgrading as we review and process more of the packages.

Don't retain older versions

Unless there is a specific need (for GPLv2, or where there are known serious bugs in the latest version) don't retain older versions of the recipe files and patches.

Use git mv for version updates

Use "git mv" to rename the old file to the new version - this means that you don't have to consciously delete the old version later.

Remove PR when upgrading recipes

PR values are now expected to be managed by the PR server.

Do not merge .inc / .bb files

We do not want to merge the common ".inc" files and recipe (.bb) files together. This is the case even if the .bb only contains a require and a PR = "r0" line. Leaving the .inc file separate allows other layers to re-use the .inc file for older/newer versions.

Style guidelines

See the OpenEmbedded style guide.

Patches

Patches should contain information about where they came from and why they are required, as the project moves forward, we want to increase the quality of the data that is made available to the community. This can be done in the recipes and also in the patch files in order to understand why the patch exists and to help future maintainer to understand why it is required.

Patch Comments

Patch comments should contain information about why the patch is required, who created the patch and when. If that information is not currently known, the the information about where the patch last came from (such as from OpenEmbedded) is very important to maintain in the patch header. Having a Signed-off-by: tag is good to acknowledge that someone looked at the patch and added the comments to ensure it is still valid and current.

To recap, patches should contain:

  • Why
  • Date created
  • Who created it
  • Any upstream information
    • link to upstream mailing list
    • link to upstream bug tracking
    • IRC info
  • Signed-off-by:
    • This is most important when importing the patch and not the original author

Patch Upstreaming

In order to keep track of patches and ultimate reduce the number of patches that the Yocto Project maintains, we need to track the status of the patches that are created. As mentioned above, the patches should contain comments about why they are created, by whom and when, we also want to track if it's appropriate to get this particular patch into the upstream project. Since we want to track this information, we need a consistent tag and set of status that can be searched. Be sure to include any URL to bug tracking, mailing list or other reference material pertaining to the patch.

Upstream-Status:

Pending
No determination has been made yet or not yet submitted to upstream
Submitted
Submitted to upstream, waiting approval
Accepted
Accepted in upstream, expect it to be removed at next update, include expected version info
Backport
Backported from new upstream version, because we are at a fixed version, include upstream version info
Denied
Not accepted by upstream, include reason in patch
Inappropriate [reason]
The patch is not appropriate for upstream, include a brief reason on the same line enclosed with []
reason can be:
native
licensing
configuration
enable feature
disable feature
bugfix (add bug url here)
embedded specific
other (give details in comments)

All patches and diff files should include this information.

Recipe Metadata Updates

LICENSE Metadata

See Recipe License Fields on the OE wiki.

Distro Tracking Fields

The meta/conf/distro/include/*.inc files exist to allow us to track various pieces of information about recipes and upstream versions (e.g, recipe maintainer contact information, date of latest upstream release, alternate names used for this recipe in other Linux distros, etc). The following defines the meaning of each field:

RECIPE_COLOR
Indicates whether the recipe has been reviewed for basic quality control information (e.g, has had its software license verified). "red" indicates these checks have not been done, and "green" indicates that they have been done.
RECIPE_UPSTREAM_VERSION
The latest upstream stable version
RECIPE_UPSTREAM_DATE
The date at which the latest upstream stable version (mentioned in RECIPE_UPSTREAM_VERSION) was released, "Mar 3, 2013"
RECIPE_MAINTAINER
Name and email address of the person maintaining the recipe, "Firstname Lastname <email.address>"
RECIPE_NO_UPDATE_REASON
Reason for not updating the recipe to a later version if applicable
DISTRO_PN_ALIAS
A list mapping package names for tracking status of package relative to major distributions such as Fedora, Ubuntu, Debian

Note that in the files, each field name is appended with _pn-<recipe name>.