Skip to contentSkip to conversation

ref-manual/variables.rst: document versioned RPROVIDES

PATCH In review Wadim Mueller 2 participants 2 messages Oct 5 – Oct 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ref-manual/variables.rst: document versioned RPROVIDES

RPROVIDES accepts the same "name (operator version)" syntax as
RDEPENDS: package_rpm parses it with bb.utils.explode_dep_versions2() and writes "Provides: name = version" into the spec file. This lets a package provide an interface level that other packages depend on with ">=", which an alias carrying the version in its name, such as the existing "widget-abi-2" example, cannot express.

package_ipk and package_deb build their Provides field from dict.fromkeys(explode_dep_versions2(RPROVIDES), []) and so drop the version, which the documentation should say next to the syntax.

---
 documentation/ref-manual/variables.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
documentation/ref-manual/variables.rst +18 -0
index 1c0864d87..b16a6272c 100644
@@ -8735,6 +8735,24 @@ system and gives an overview of their function and contents.
 
          RPROVIDES:${PN} = "widget-abi-2"
 
+      An alias can also carry a version, using the same syntax as
+      :term:`RDEPENDS` with the ``=`` operator::
+
+         RPROVIDES:${PN} = "widget-abi (= 2)"
+
+      Other packages can then depend on a range of versions of the alias,
+      which an alias with the version in its name cannot express::
+
+         RDEPENDS:${PN} = "widget-abi (>= 2)"
+
+      .. note::
+
+         Only the :ref:`ref-classes-package_rpm` class writes the version
+         into the package metadata. The :ref:`ref-classes-package_ipk` and
+         :ref:`ref-classes-package_deb` classes drop it and provide the bare
+         alias, so a versioned dependency on the alias cannot be relied upon
+         with those package formats.
+
    :term:`RRECOMMENDS`
       A list of packages that extends the usability of a package being
       built. The package being built does not depend on this list of
Signature · 1 line
2.43.0
#1 lore raw

Hi,

Quoted 21 lines · Wadim Müller via lists.yoctoproject.org

RPROVIDES accepts the same "name (operator version)" syntax as
RDEPENDS: package_rpm parses it with bb.utils.explode_dep_versions2() and writes "Provides: name = version" into the spec file. This lets a package provide an interface level that other packages depend on with ">=", which an alias carrying the version in its name, such as the existing "widget-abi-2" example, cannot express.

package_ipk and package_deb build their Provides field from dict.fromkeys(explode_dep_versions2(RPROVIDES), []) and so drop the version, which the documentation should say next to the syntax.

---
 documentation/ref-manual/variables.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
documentation/ref-manual/variables.rst +0 -0
index 1c0864d87..b16a6272c 100644

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8743

Quoted 9 lines
documentation/ref-manual/variables.rst +6 -0
@@ -8735,6 +8735,24 @@ system and gives an overview of their function and contents.
 
          RPROVIDES:${PN} = "widget-abi-2"
 
+      An alias can also carry a version, using the same syntax as
+      :term:`RDEPENDS` with the ``=`` operator::
+
+         RPROVIDES:${PN} = "widget-abi (= 2)"
+
+      Other packages can then depend on a range of versions of the alias,

This I understand,

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8744

Quoted 1 line
documentation/ref-manual/variables.rst +1 -0
+      which an alias with the version in its name cannot express::

But this I'm not sure. Are you saying that you cannot write:

  RPROVIDES:${PN} = "widget-abi (>= 2)"

?

If that's what you wanted to say, maybe I would explain in a separate paragraph, after the RDEPENDS snippet below, with an example. Also, what happens if you write the example above? Does the build fail?

Quoted 4 lines
documentation/ref-manual/variables.rst +4 -0
+
+         RDEPENDS:${PN} = "widget-abi (>= 2)"
+
+      .. note::

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8758

Quoted 10 lines
documentation/ref-manual/variables.rst +7 -0
+
+         Only the :ref:`ref-classes-package_rpm` class writes the version
+         into the package metadata. The :ref:`ref-classes-package_ipk` and
+         :ref:`ref-classes-package_deb` classes drop it and provide the bare
+         alias, so a versioned dependency on the alias cannot be relied upon
+         with those package formats.
+
    :term:`RRECOMMENDS`
       A list of packages that extends the usability of a package being
       built. The package being built does not depend on this list of

Thanks,
Antonin
text:
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 12 Oct 2026 15:58:12 +0200
Message-Id: <[email protected]>
Subject: Re: [docs] [PATCH] ref-manual/variables.rst: document versioned
RPROVIDES
From: "Antonin Godard" <[email protected]>
To: <[email protected]>, <[email protected]>
References: <[email protected]>
In-Reply-To: <[email protected]>
X-TUID: RiwbBQw8U+XC

Hi,

Quoted 21 lines · Wadim Müller via lists.yoctoproject.org

RPROVIDES accepts the same "name (operator version)" syntax as
RDEPENDS: package_rpm parses it with bb.utils.explode_dep_versions2() and writes "Provides: name = version" into the spec file. This lets a package provide an interface level that other packages depend on with ">=", which an alias carrying the version in its name, such as the existing "widget-abi-2" example, cannot express.

package_ipk and package_deb build their Provides field from dict.fromkeys(explode_dep_versions2(RPROVIDES), []) and so drop the version, which the documentation should say next to the syntax.

---
 documentation/ref-manual/variables.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
documentation/ref-manual/variables.rst +0 -0
index 1c0864d87..b16a6272c 100644

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8743

Quoted 9 lines
documentation/ref-manual/variables.rst +6 -0
@@ -8735,6 +8735,24 @@ system and gives an overview of their function and contents.
 
          RPROVIDES:${PN} = "widget-abi-2"
 
+      An alias can also carry a version, using the same syntax as
+      :term:`RDEPENDS` with the ``=`` operator::
+
+         RPROVIDES:${PN} = "widget-abi (= 2)"
+
+      Other packages can then depend on a range of versions of the alias,

This I understand,

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8744

Quoted 1 line
documentation/ref-manual/variables.rst +1 -0
+      which an alias with the version in its name cannot express::

But this I'm not sure. Are you saying that you cannot write:

  RPROVIDES:${PN} = "widget-abi (>= 2)"

?

If that's what you wanted to say, maybe I would explain in a separate paragraph, after the RDEPENDS snippet below, with an example. Also, what happens if you write the example above? Does the build fail?

Quoted 4 lines
documentation/ref-manual/variables.rst +4 -0
+
+         RDEPENDS:${PN} = "widget-abi (>= 2)"
+
+      .. note::

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 8758

Quoted 10 lines
documentation/ref-manual/variables.rst +7 -0
+
+         Only the :ref:`ref-classes-package_rpm` class writes the version
+         into the package metadata. The :ref:`ref-classes-package_ipk` and
+         :ref:`ref-classes-package_deb` classes drop it and provide the bare
+         alias, so a versioned dependency on the alias cannot be relied upon
+         with those package formats.
+
    :term:`RRECOMMENDS`
       A list of packages that extends the usability of a package being
       built. The package being built does not depend on this list of

Thanks,
Antonin