Update the documentation for SRCPV
PATCH v2 1/1 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.
---
Changes in v2:
- Fix typos reported by Quentin.
- kernel-dev/common: mention that +git is combined to LINUX_VERSION.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- .../contributor-guide/recipe-style-guide.rst | 6 ++-- documentation/dev-manual/external-scm.rst | 9 +++-- documentation/dev-manual/new-recipe.rst | 10 +++--- documentation/dev-manual/packages.rst | 13 +++---- documentation/kernel-dev/common.rst | 13 ++----- documentation/ref-manual/variables.rst | 42 +++++++++++----------- 6 files changed, 43 insertions(+), 50 deletions(-)
documentation/contributor-guide/recipe-style-guide.rst +3 -3
@@ -47,10 +47,10 @@ Debian policy closely. 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 -should include the Git revision using the following to make the -version clear:: +should include the sign ``+``, so :term:`bitbake` automatically includes package +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 software from the current source revision (``git describe`` can be useful for
documentation/dev-manual/external-scm.rst +6 -3
@@ -12,10 +12,13 @@ revision number for changes. Currently, you can do this with Apache Subversion (SVN), Git, and Bazaar (BZR) repositories. To enable this behavior, the :term:`PV` of -the recipe needs to reference -:term:`SRCPV`. Here is an example:: +the recipe needs to include a ``+`` sign in its assignment. +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 ``local.conf``::
documentation/dev-manual/new-recipe.rst +5 -5
@@ -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, 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 -``meta/recipes-core/musl/gcompat_git.bb``:: +a ``+`` sign in its definition. Here is an example from the recipe +: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}" - SRCREV = "af5a49e489fdc04b9cf02547650d7aeaccd43793" + PV = "0.8.18.1.11+git" + SRCREV ="3cdccdc9505643e50f8208171d9eee5de11a42ff" If your :term:`SRC_URI` statement includes URLs pointing to individual files fetched from a remote server other than a version control system,
documentation/dev-manual/packages.rst +4 -9
@@ -84,10 +84,6 @@ the following: - :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 network-based service that helps automate keeping package feeds compatible with existing package manager applications such as RPM,
@@ -256,15 +252,14 @@ the software:: 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 code changes. Here is an example:: - PV = "1.0+git${SRCPV}" - -The OpenEmbedded build system substitutes :term:`SRCPV` with the following: + PV = "1.0+git" -.. code-block:: none +The OpenEmbedded build system will automatically add the source control +information to the end of the variable :term:`PKGV`, in this format:: AUTOINC+source_code_revision
documentation/kernel-dev/common.rst +3 -10
@@ -1562,16 +1562,9 @@ Here are some basic steps you can use to work with your own sources: changed. - :term:`PV`: The default :term:`PV` - assignment is typically adequate. It combines the - :term:`LINUX_VERSION` with the Source Control Manager (SCM) revision - as derived from the :term:`SRCPV` - 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. + assignment is typically adequate. It combines the value of + :term:`LINUX_VERSION` and the value ``+git`` which adds source control + information to :term:`PKGV` later during the packaging phase. - :term:`COMPATIBLE_MACHINE`: A list of the machines supported by your new recipe. This variable
documentation/ref-manual/variables.rst +22 -20
71 lines not on this page · raw message
---
base-commit: f064af984c491707dd5a0917e68a033f6c2104f6
change-id: 20241115-deprecated-srcpv-809341065cdf
Best regards,
Signature · 1 line
Antonin Godard <[email protected]>
Hi Antonin,
Quoted 17 lines · Antonin Godard
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.
Signed-off-by Antonin Godard <[email protected]>---
[...]
Quoted 10 lines
documentation/ref-manual/variables.rst +0
-2@@ -209,12 +209,11 @@ system and gives an overview of their function and contents. SRCREV = "${AUTOREV}" If you use the previous statement to retrieve the latest version of - software, you need to be sure :term:`PV` contains - ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 217
Quoted 10 lines
documentation/ref-manual/variables.rst +5
-4- recipe that inherits the :ref:`ref-classes-kernel` class and you - use the previous statement. In this example, ``${SRCPV}`` does not - automatically get into :term:`PV`. Consequently, you need to change - :term:`PV` in your recipe so that it does contain ``${SRCPV}``. + software, you need to make sure :term:`PV` contains the ``+`` sign so + :term:`bitbake` includes source control information to :term:`PKGV` when + packaging the recipe. For example:: + + PV = "6.10.y+git"
I believe this is not properly indented? Missing a space here to follow our standards?
Quoted 12 lines
documentation/ref-manual/variables.rst +1
-1For more information see the ":ref:`dev-manual/packages:automatically incrementing a package version number`"@@ -5152,7 +5151,7 @@ system and gives an overview of their function and contents. The :term:`LINUX_VERSION` variable is used to define :term:`PV` for the recipe:: - PV = "${LINUX_VERSION}+git${SRCPV}" + PV = "${LINUX_VERSION}+git" :term:`LINUX_VERSION_EXTENSION` A string extension compiled into the version string of the Linux
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 6723
Quoted 6 lines
documentation/ref-manual/variables.rst +1
-1@@ -6720,9 +6719,10 @@ system and gives an overview of their function and contents. 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}" + PV = "1.1+git${@bb.fetch2.get_srcrev(d)}"
Getting back at my original comment in v1 (forgot to answer again there, so doing it here). I'm not sure this makes sense as an example as it is not necessary anymore since + character is enough to include that information in PKGV (as far as I understood from the patch). I would like to avoid suggesting using something that isn't relevant here (or discouraged).
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Otherwise, I don't really know what kind of example we could provide that would match the state before the + character behavior change.
Looks good otherwise!
Cheers,
Quentin
Hi Quentin,
Quoted 28 lines · Quentin Schulz
Hi Antonin,
Quoted 17 lines · Antonin Godard
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.
Signed-off-by Antonin Godard <[email protected]>---
[...]
Quoted 7 lines
documentation/ref-manual/variables.rst +0
-0@@ -209,12 +209,11 @@ system and gives an overview of their function and contents. SRCREV = "${AUTOREV}"
Quoted 16 lines
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 217
Quoted 13 lines
documentation/ref-manual/variables.rst +5
-6If you use the previous statement to retrieve the latest version of - software, you need to be sure :term:`PV` contains - ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel - recipe that inherits the :ref:`ref-classes-kernel` class and you - use the previous statement. In this example, ``${SRCPV}`` does not - automatically get into :term:`PV`. Consequently, you need to change - :term:`PV` in your recipe so that it does contain ``${SRCPV}``. + software, you need to make sure :term:`PV` contains the ``+`` sign so + :term:`bitbake` includes source control information to :term:`PKGV` when + packaging the recipe. For example:: + + PV = "6.10.y+git"I believe this is not properly indented? Missing a space here to follow our standards?
Good catch, thank you. Some others below are also not properly indented. It would be nice if sphinx-lint could report this, but I don't think it is able to.
Quoted 15 lines
Quoted 15 lines
documentation/ref-manual/variables.rst +1
-1For more information see the ":ref:`dev-manual/packages:automatically incrementing a package version number`"@@ -5152,7 +5151,7 @@ system and gives an overview of their function and contents. The :term:`LINUX_VERSION` variable is used to define :term:`PV` for the recipe:: - PV = "${LINUX_VERSION}+git${SRCPV}" + PV = "${LINUX_VERSION}+git" :term:`LINUX_VERSION_EXTENSION` A string extension compiled into the version string of the Linux@@ -6720,9 +6719,10 @@ system and gives an overview of their function and contents. For example, consider two recipes ``foo_1.2.bb`` and ``foo_git.bb`` where ``foo_git.bb`` contains the following assignment::
Quoted 8 lines
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 6723
Quoted 3 lines
documentation/ref-manual/variables.rst +1
-1- PV = "1.1+git${SRCPV}" + PV = "1.1+git${@bb.fetch2.get_srcrev(d)}"Getting back at my original comment in v1 (forgot to answer again there, so doing it here). I'm not sure this makes sense as an example as it is not necessary anymore since + character is enough to include that information in PKGV (as far as I understood from the patch). I would
Exactly, "+" is enough now.
Quoted 6 lines
like to avoid suggesting using something that isn't relevant here (or discouraged).
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Ok, something like:
If your PV is equal to "a.b.c+git", you can match it with "a.b.c%" in PREFERRED_VERSION?
This makes more sense with the current state of things, and simplifies the example a bit.
Quoted 4 lines
Otherwise, I don't really know what kind of example we could provide that would match the state before the + character behavior change.
Looks good otherwise!
Thanks!
Antonin
Signature · 3 lines
Antonin Godard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Antonin,
Quoted 49 lines · Antonin Godard
Hi Quentin,
Quoted 28 lines · Quentin Schulz
Hi Antonin,
Quoted 17 lines · Antonin Godard
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.
Signed-off-by Antonin Godard <[email protected]>---
[...]
Quoted 7 lines
documentation/ref-manual/variables.rst +0
-0@@ -209,12 +209,11 @@ system and gives an overview of their function and contents. SRCREV = "${AUTOREV}"Quoted 16 lines
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 217
Quoted 13 lines
documentation/ref-manual/variables.rst +5
-6If you use the previous statement to retrieve the latest version of - software, you need to be sure :term:`PV` contains - ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel - recipe that inherits the :ref:`ref-classes-kernel` class and you - use the previous statement. In this example, ``${SRCPV}`` does not - automatically get into :term:`PV`. Consequently, you need to change - :term:`PV` in your recipe so that it does contain ``${SRCPV}``. + software, you need to make sure :term:`PV` contains the ``+`` sign so + :term:`bitbake` includes source control information to :term:`PKGV` when + packaging the recipe. For example:: + + PV = "6.10.y+git"I believe this is not properly indented? Missing a space here to follow our standards?
Quoted 3 lines
Good catch, thank you. Some others below are also not properly indented. It would be nice if sphinx-lint could report this, but I don't think it is able to.
It's open-source, so maybe something we can contribute :)
Quoted 33 lines
Quoted 15 lines
Quoted 15 lines
documentation/ref-manual/variables.rst +1
-1For more information see the ":ref:`dev-manual/packages:automatically incrementing a package version number`"@@ -5152,7 +5151,7 @@ system and gives an overview of their function and contents. The :term:`LINUX_VERSION` variable is used to define :term:`PV` for the recipe:: - PV = "${LINUX_VERSION}+git${SRCPV}" + PV = "${LINUX_VERSION}+git" :term:`LINUX_VERSION_EXTENSION` A string extension compiled into the version string of the Linux@@ -6720,9 +6719,10 @@ system and gives an overview of their function and contents. For example, consider two recipes ``foo_1.2.bb`` and ``foo_git.bb`` where ``foo_git.bb`` contains the following assignment::Quoted 8 lines
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 6723
Quoted 3 lines
documentation/ref-manual/variables.rst +1
-1- PV = "1.1+git${SRCPV}" + PV = "1.1+git${@bb.fetch2.get_srcrev(d)}"Getting back at my original comment in v1 (forgot to answer again there, so doing it here). I'm not sure this makes sense as an example as it is not necessary anymore since + character is enough to include that information in PKGV (as far as I understood from the patch). I would
Exactly, "+" is enough now.
Quoted 6 lines
like to avoid suggesting using something that isn't relevant here (or discouraged).
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Quoted 8 lines
Ok, something like:
If your PV is equal to "a.b.c+git", you can match it with "a.b.c%" in
PREFERRED_VERSION?This makes more sense with the current state of things, and simplifies the example a bit.
"""
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 :term:PREFERRED_VERSION_foo to 1.2.3% (i.e. using simply git will not work as the name of the recipe isn't used, but rather its :term:PV). """
or something like that?
Is PV really extended with the git hash when there's a + in there or is it only PKGV that gets it? Basically, do you even need % character when we have a + in PV now?
Not sure it's clear, lemme know if I need to rephrase my question.
Cheers,
Quentin
Hi Quentin,
Quoted 52 lines · Quentin Schulz via lists.yoctoproject.org
Hi Antonin,
Quoted 49 lines · Antonin Godard
Hi Quentin,
Quoted 44 lines · Quentin Schulz
Hi Antonin,
Quoted 17 lines · Antonin Godard
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.
Signed-off-by Antonin Godard <[email protected]>---
[...]
Quoted 10 lines
documentation/ref-manual/variables.rst +0
-2@@ -209,12 +209,11 @@ system and gives an overview of their function and contents. SRCREV = "${AUTOREV}" If you use the previous statement to retrieve the latest version of - software, you need to be sure :term:`PV` contains - ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kerneldocumentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 217
Quoted 10 lines
documentation/ref-manual/variables.rst +5
-4- recipe that inherits the :ref:`ref-classes-kernel` class and you - use the previous statement. In this example, ``${SRCPV}`` does not - automatically get into :term:`PV`. Consequently, you need to change - :term:`PV` in your recipe so that it does contain ``${SRCPV}``. + software, you need to make sure :term:`PV` contains the ``+`` sign so + :term:`bitbake` includes source control information to :term:`PKGV` when + packaging the recipe. For example:: + + PV = "6.10.y+git"I believe this is not properly indented? Missing a space here to follow our standards?
Quoted 5 lines
Quoted 3 lines
Good catch, thank you. Some others below are also not properly indented. It would be nice if sphinx-lint could report this, but I don't think it is able to.
It's open-source, so maybe something we can contribute :)
For sure. I took a glance at it, and there's no support for any config file at all so that would be a first step to add, considering 2 or 3 spaces is a personal choice.
[...]
Quoted 20 lines
Quoted 4 lines
Quoted 3 lines
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Quoted 8 lines
Ok, something like:
If your PV is equal to "a.b.c+git", you can match it with "a.b.c%" in
PREFERRED_VERSION?This makes more sense with the current state of things, and simplifies the example a bit.
"""
If you want to select a recipe named foo_git.bb which has :term:PVset to1.2.3+git, you can do so by setting :term:PREFERRED_VERSION_footo1.2.3%(i.e. using simplygitwill not work as the name of the recipe isn't used, but rather its :term:PV).
"""
Quoted 7 lines
or something like that?
Is PV really extended with the git hash when there's a + in there or is it only PKGV that gets it? Basically, do you even need % character when we have a + in PV now?
Not sure it's clear, lemme know if I need to rephrase my question.
So yes you got it right: PV will never contain the hash, only PKGV will (and only during do_install iirc, so bitbake-getvar PKGV will not show the hash).
Which makes me wonder if giving the example above is any useful, since you could just set PREFERRED_VERSION_foo to "1.2.3+git".
Antonin
Signature · 3 lines
Antonin Godard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Antonin,
Quoted 59 lines · Antonin Godard
Hi Quentin,
Quoted 56 lines · Quentin Schulz via lists.yoctoproject.org
Hi Antonin,
Quoted 52 lines · Antonin Godard
Hi Quentin,
Quoted 28 lines · Quentin Schulz
Hi Antonin,
Quoted 17 lines · Antonin Godard
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.
Signed-off-by Antonin Godard <[email protected]>---
[...]
Quoted 7 lines
documentation/ref-manual/variables.rst +0
-0@@ -209,12 +209,11 @@ system and gives an overview of their function and contents. SRCREV = "${AUTOREV}"Quoted 16 lines
documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 217
Quoted 13 lines
documentation/ref-manual/variables.rst +5
-6If you use the previous statement to retrieve the latest version of - software, you need to be sure :term:`PV` contains - ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel - recipe that inherits the :ref:`ref-classes-kernel` class and you - use the previous statement. In this example, ``${SRCPV}`` does not - automatically get into :term:`PV`. Consequently, you need to change - :term:`PV` in your recipe so that it does contain ``${SRCPV}``. + software, you need to make sure :term:`PV` contains the ``+`` sign so + :term:`bitbake` includes source control information to :term:`PKGV` when + packaging the recipe. For example:: + + PV = "6.10.y+git"I believe this is not properly indented? Missing a space here to follow our standards?
Good catch, thank you. Some others below are also not properly indented. It would be nice if sphinx-lint could report this, but I don't think it is able to.
Quoted 6 lines
Quoted 1 line
It's open-source, so maybe something we can contribute :)
For sure. I took a glance at it, and there's no support for any config file at all so that would be a first step to add, considering 2 or 3 spaces is a personal choice.
Another option is just to check whether the indentation is consistent, which wouldn't require a configuration file.
Quoted 27 lines
[...]
Quoted 26 lines
Quoted 4 lines
Quoted 3 lines
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Quoted 8 lines
Ok, something like:
If your PV is equal to "a.b.c+git", you can match it with "a.b.c%" in
PREFERRED_VERSION?This makes more sense with the current state of things, and simplifies the example a bit.
"""
If you want to select a recipe named foo_git.bb which has :term:PVset to1.2.3+git, you can do so by setting :term:PREFERRED_VERSION_footo1.2.3%(i.e. using simplygitwill not work as the name of the recipe isn't used, but rather its :term:PV).
"""or something like that?
Is PV really extended with the git hash when there's a + in there or is it only PKGV that gets it? Basically, do you even need % character when we have a + in PV now?
Quoted 8 lines
Quoted 1 line
Not sure it's clear, lemme know if I need to rephrase my question.
So yes you got it right: PV will never contain the hash, only PKGV will (and only during
do_installiirc, so bitbake-getvar PKGV will not show the hash).Which makes me wonder if giving the example above is any useful, since you could just set
PREFERRED_VERSION_footo "1.2.3+git".
It is useful! The point is to highlight the "version" in the filename of the recipe is not the one you should use in PREFERRED_VERSION, but rather the value of PV. Incidentally, PV = version in the filename by default I believe (maybe for the git ones too?) but it is recommended/required to set PV for git recipes. So in order to pick the git recipe, you need to use the PV set inside the git recipe and not use "git" along. I believe this is what the original author wanted this example to transpire?
Cheers,
Quentin
Hi Quentin,
On Wed Nov 27, 2024 at 3:08 PM CET, Quentin Schulz via lists.yoctoproject.org wrote:
[...]
Quoted 35 lines
Quoted 26 lines
Quoted 26 lines
Quoted 4 lines
Quoted 3 lines
I think we could simplify the example. The point is not necessarily to use % with a git-named recipe but rather that a git-named recipe is not going to match "git" but the "PV" defined in the recipe. What do you think?
Quoted 8 lines
Ok, something like:
If your PV is equal to "a.b.c+git", you can match it with "a.b.c%" in
PREFERRED_VERSION?This makes more sense with the current state of things, and simplifies the example a bit.
"""
If you want to select a recipe named foo_git.bb which has :term:PVset to1.2.3+git, you can do so by setting :term:PREFERRED_VERSION_footo1.2.3%(i.e. using simplygitwill not work as the name of the recipe isn't used, but rather its :term:PV).
"""or something like that?
Is PV really extended with the git hash when there's a + in there or is it only PKGV that gets it? Basically, do you even need % character when we have a + in PV now?
Quoted 8 lines
Quoted 1 line
Not sure it's clear, lemme know if I need to rephrase my question.
So yes you got it right: PV will never contain the hash, only PKGV will (and only during
do_installiirc, so bitbake-getvar PKGV will not show the hash).Which makes me wonder if giving the example above is any useful, since you could just set
PREFERRED_VERSION_footo "1.2.3+git".
Quoted 8 lines
It is useful! The point is to highlight the "version" in the filename of the recipe is not the one you should use in
PREFERRED_VERSION, but rather the value of PV. Incidentally, PV = version in the filename by default I believe (maybe for the git ones too?) but it is recommended/required to set PV for git recipes. So in order to pick the git recipe, you need to use the PV set inside the git recipe and not use "git" along. I believe this is what the original author wanted this example to transpire?
I didn't think of it that way, but yes, maybe the author wanted to transpire this + the fact that in the hash wasn't predictable hence the "%". Or only one or the other.
In any case, I get what you mean, and I'll update the description in a v3.
Thanks,
Antonin
Signature · 3 lines
Antonin Godard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com