1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

Update the documentation for SRCPV

The variable SRCPV is deprecated since 4.3. Instead of including SRCPV
in PV, including the sign "+" is enough for bitbake to add the source
control information to PKGV during the packaging phase.

Update the documentation for SRCPV and the places where it was used.
When instructions previously referred to SRCPV, replace by mentioning to
include "+" in the assignment.

In most examples, "+git" is added to PV as it is the most popular SCM.
Simply adding "+" is also possible, although it is better practice to
include the SCM name, so give that example.

Update the gcompat example with l3afpad as it didn't include "+git" in
its PV definition anymore.

(From yocto-docs rev: ee16c96202e5027d1a8d7e89e11c25f127c78326)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Antonin Godard
2024-12-09 17:43:43 +01:00
committed by Richard Purdie
parent 6968e17ae5
commit c9565b89d0
6 changed files with 47 additions and 63 deletions
@@ -47,10 +47,10 @@ Debian policy closely.
When a recipe references a git revision that does not correspond to a released When a recipe references a git revision that does not correspond to a released
version of software (e.g. is not a tagged version), the :term:`PV` variable version of software (e.g. is not a tagged version), the :term:`PV` variable
should include the Git revision using the following to make the should include the sign ``+``, so :term:`bitbake` automatically includes package
version clear:: version information during the packaging phase::
PV = "<version>+git${SRCPV}" PV = "<version>+git"
In this case, ``<version>`` should be the most recently released version of the In this case, ``<version>`` should be the most recently released version of the
software from the current source revision (``git describe`` can be useful for software from the current source revision (``git describe`` can be useful for
+6 -3
View File
@@ -12,10 +12,13 @@ revision number for changes. Currently, you can do this with Apache
Subversion (SVN), Git, and Bazaar (BZR) repositories. Subversion (SVN), Git, and Bazaar (BZR) repositories.
To enable this behavior, the :term:`PV` of To enable this behavior, the :term:`PV` of
the recipe needs to reference the recipe needs to include a ``+`` sign in its assignment.
:term:`SRCPV`. Here is an example:: Here is an example::
PV = "1.2.3+git${SRCPV}" PV = "1.2.3+git"
:term:`Bitbake` later includes the source control information in :term:`PKGV`
during the packaging phase.
Then, you can add the following to your Then, you can add the following to your
``local.conf``:: ``local.conf``::
+5 -5
View File
@@ -291,13 +291,13 @@ another example that specifies these types of files, see the
Another way of specifying source is from an SCM. For Git repositories, Another way of specifying source is from an SCM. For Git repositories,
you must specify :term:`SRCREV` and you should specify :term:`PV` to include you must specify :term:`SRCREV` and you should specify :term:`PV` to include
the revision with :term:`SRCPV`. Here is an example from the recipe a ``+`` sign in its definition. Here is an example from the recipe
``meta/recipes-core/musl/gcompat_git.bb``:: :oe_git:`meta/recipes-sato/l3afpad/l3afpad_git.bb </openembedded-core/tree/meta/recipes-sato/l3afpad/l3afpad_git.bb>`::
SRC_URI = "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current" SRC_URI = "git://github.com/stevenhoneyman/l3afpad.git;branch=master;protocol=https"
PV = "1.0.0+1.1+git${SRCPV}" PV = "0.8.18.1.11+git"
SRCREV = "af5a49e489fdc04b9cf02547650d7aeaccd43793" SRCREV ="3cdccdc9505643e50f8208171d9eee5de11a42ff"
If your :term:`SRC_URI` statement includes URLs pointing to individual files If your :term:`SRC_URI` statement includes URLs pointing to individual files
fetched from a remote server other than a version control system, fetched from a remote server other than a version control system,
+4 -9
View File
@@ -84,10 +84,6 @@ the following:
- :term:`PR`: The recipe revision. - :term:`PR`: The recipe revision.
- :term:`SRCPV`: The OpenEmbedded
build system uses this string to help define the value of :term:`PV` when
the source code revision needs to be included in it.
- :yocto_wiki:`PR Service </PR_Service>`: A - :yocto_wiki:`PR Service </PR_Service>`: A
network-based service that helps automate keeping package feeds network-based service that helps automate keeping package feeds
compatible with existing package manager applications such as RPM, compatible with existing package manager applications such as RPM,
@@ -256,15 +252,14 @@ the software::
SRCREV = "${AUTOREV}" SRCREV = "${AUTOREV}"
Furthermore, you need to reference :term:`SRCPV` in :term:`PV` in order to Furthermore, you need to include a ``+`` sign in :term:`PV` in order to
automatically update the version whenever the revision of the source automatically update the version whenever the revision of the source
code changes. Here is an example:: code changes. Here is an example::
PV = "1.0+git${SRCPV}" PV = "1.0+git"
The OpenEmbedded build system substitutes :term:`SRCPV` with the following: The OpenEmbedded build system will automatically add the source control
information to the end of the variable :term:`PKGV`, in this format::
.. code-block:: none
AUTOINC+source_code_revision AUTOINC+source_code_revision
+3 -10
View File
@@ -1562,16 +1562,9 @@ Here are some basic steps you can use to work with your own sources:
changed. changed.
- :term:`PV`: The default :term:`PV` - :term:`PV`: The default :term:`PV`
assignment is typically adequate. It combines the assignment is typically adequate. It combines the value of
:term:`LINUX_VERSION` with the Source Control Manager (SCM) revision :term:`LINUX_VERSION` and the value ``+git`` which adds source control
as derived from the :term:`SRCPV` information to :term:`PKGV` later during the packaging phase.
variable. The combined results are a string with the following
form::
3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2
While lengthy, the extra verbosity in :term:`PV` helps ensure you are
using the exact sources from which you intend to build.
- :term:`COMPATIBLE_MACHINE`: - :term:`COMPATIBLE_MACHINE`:
A list of the machines supported by your new recipe. This variable A list of the machines supported by your new recipe. This variable
+26 -33
View File
@@ -209,12 +209,11 @@ system and gives an overview of their function and contents.
SRCREV = "${AUTOREV}" SRCREV = "${AUTOREV}"
If you use the previous statement to retrieve the latest version of If you use the previous statement to retrieve the latest version of
software, you need to be sure :term:`PV` contains software, you need to make sure :term:`PV` contains the ``+`` sign so
``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel :term:`bitbake` includes source control information to :term:`PKGV` when
recipe that inherits the :ref:`ref-classes-kernel` class and you packaging the recipe. For example::
use the previous statement. In this example, ``${SRCPV}`` does not
automatically get into :term:`PV`. Consequently, you need to change PV = "6.10.y+git"
:term:`PV` in your recipe so that it does contain ``${SRCPV}``.
For more information see the For more information see the
":ref:`dev-manual/packages:automatically incrementing a package version number`" ":ref:`dev-manual/packages:automatically incrementing a package version number`"
@@ -5157,7 +5156,7 @@ system and gives an overview of their function and contents.
The :term:`LINUX_VERSION` variable is used to define :term:`PV` The :term:`LINUX_VERSION` variable is used to define :term:`PV`
for the recipe:: for the recipe::
PV = "${LINUX_VERSION}+git${SRCPV}" PV = "${LINUX_VERSION}+git"
:term:`LINUX_VERSION_EXTENSION` :term:`LINUX_VERSION_EXTENSION`
A string extension compiled into the version string of the Linux A string extension compiled into the version string of the Linux
@@ -6720,22 +6719,14 @@ system and gives an overview of their function and contents.
string. You cannot use the wildcard character in any other string. You cannot use the wildcard character in any other
location of the string. location of the string.
The specified version is matched against :term:`PV`, which The specified version is matched against :term:`PV`, which does not
does not necessarily match the version part of the recipe's filename. necessarily match the version part of the recipe's filename.
For example, consider two recipes ``foo_1.2.bb`` and ``foo_git.bb``
where ``foo_git.bb`` contains the following assignment::
PV = "1.1+git${SRCPV}" If you want to select a recipe named ``foo_git.bb`` which has :term:`PV`
set to ``1.2.3+git``, you can do so by setting ```PREFERRED_VERSION_foo``
In this case, the correct way to select to ``1.2.3%`` (i.e. simply setting ``PREFERRED_VERSION_foo`` to ``git``
``foo_git.bb`` is by using an assignment such as the following:: will not work as the name of the recipe isn't used, but rather its
:term:`PV` definition).
PREFERRED_VERSION_foo = "1.1+git%"
Compare that previous example
against the following incorrect example, which does not work::
PREFERRED_VERSION_foo = "git"
Sometimes the :term:`PREFERRED_VERSION` variable can be set by Sometimes the :term:`PREFERRED_VERSION` variable can be set by
configuration files in a way that is hard to change. You can use configuration files in a way that is hard to change. You can use
@@ -8321,21 +8312,23 @@ system and gives an overview of their function and contents.
(SCM). (SCM).
:term:`SRCPV` :term:`SRCPV`
Returns the version string of the current package. This string is The variable :term:`SRCPV` is deprecated. It was previously used to
used to help define the value of :term:`PV`. include source control information in :term:`PV` for :term:`bitbake` to
work correctly but this is no longer a requirement. Source control
information will be automatically included by :term:`bitbake` in the
variable :term:`PKGV` during packaging if the ``+`` sign is present in
:term:`PV`.
The :term:`SRCPV` variable is defined in the ``meta/conf/bitbake.conf`` .. note::
configuration file in the :term:`Source Directory` as
follows::
SRCPV = "${@bb.fetch2.get_srcrev(d)}" The :term:`SRCPV` variable used to be defined in the
``meta/conf/bitbake.conf`` configuration file in the :term:`Source
Directory` as follows::
Recipes that need to define :term:`PV` do so with the help of the SRCPV = "${@bb.fetch2.get_srcrev(d)}"
:term:`SRCPV`. For example, the ``ofono`` recipe (``ofono_git.bb``)
located in ``meta/recipes-connectivity`` in the Source Directory
defines :term:`PV` as follows::
PV = "0.12-git${SRCPV}" The ``get_srcrev`` function can still be used to include source control
information in variables manually.
:term:`SRCREV` :term:`SRCREV`
The revision of the source code used to build the package. This The revision of the source code used to build the package. This