Skip to contentSkip to conversation

dev-manual/packages.rst: pr server fixes

PATCH Applied Antonin Godard 1 participant 5 messages Jan 27 – Feb 13

lore
Share & tools
lore
#0 lore raw

v2 cover dev-manual/packages.rst: pr server fixes

---
Changes in v2:
- Add two patches to fix the examples.
- Link to v1: https://patch.msgid.link/20260120-pr-server-increment-details-v1-1-fa5d288def24@bootlin.com

---
Antonin Godard (3):
dev-manual/packages.rst: pr server: fix and explain why r0.X increments on SRCREV change dev-manual/packages.rst: rename r0.0 to r0 when PR server is not enabled dev-manual/packages.rst: fix example recipe version

 documentation/dev-manual/packages.rst | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

---
base-commit: b8a56b8b2e8c0417b2f7204f80c79b05d95e9ce4
change-id: 20260120-pr-server-increment-details-3aa4ec0f6038

#1 lore raw

PATCH v2 1/3 dev-manual/packages.rst: pr server: fix and explain why r0.X increments on SRCREV change

The current example of the SRCREV change triggering a gitX bump is wrong, as both gitX and r0.X get incremented.

Why this is happening is explained in bug 15729, which I copy here:

Quoted 22 lines

+gitX+ is indeed related to changes in the source code.

r0.X is bumped each time the checksum of the do_package task of the simple-hello-world-git recipe changes. This happens here:
https://git.openembedded.org/openembedded-core/tree/meta/classes-global/package.bbclass?id=235e6d49e5888ad04416219e10b6df91a738661a#n306

This line sets the value of PRAUTO and represents the number X found in r0.X. It will in the end make it into EXTENDPRAUTO, which itself makes to PKGR == r0.X.

This line calls getPR(version, pkgarch, checksum). Between test case 5 and 6, only the checksum changes. This checksum is the checksum of the do_package task (gotten from get_do_package_hash() above).

Now, let's dump what changed with regards to this task between two consecutive runs, using the sigdata file in build/tmp/stamps/:

```
[...]
Variable fetcher_hashes_dummyfunc value changed from '2650ad6714c3f3248abfe9d3daf1196f307ed494' to '4af682a50174f5deb0397847da97d7cdba4ad067'
```
Quoted 6 lines

The last line shows that the value of fetcher_hashes_dummyfunc changed from '2650ad6714c3f3248abfe9d3daf1196f307ed494' to '4af682a50174f5deb0397847da97d7cdba4ad067'. Those are the commit hashes in the git history of the simple-hello-world-git repository.

Now you can see why this 0.X gets bumped, is because of the SRCREV change.

Fix the example, and detail what gets changed and why.

[YOCTO #15729]

---
 documentation/dev-manual/packages.rst | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
documentation/dev-manual/packages.rst +16 -1
index 8bd48c8e8..86a569b67 100644
@@ -275,7 +275,22 @@ with a number. The number used depends on the state of the PR Service:
    .. code-block:: none
 
       hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
-      hello-world-git_0.0+git1+dd2f5c3565-r0.0_armv7a-neon.ipk
+      hello-world-git_0.0+git1+dd2f5c3565-r0.1_armv7a-neon.ipk
+
+   Two numbers got incremented here:
+
+   -  ``gitX`` changed from ``git0`` to ``git1``. This is because there was a
+      change in the source code (``SRCREV``).
+
+   -  ``r0.X`` changed from ``r0.0`` to ``r0.1``. This is because the hash of
+      the :ref:`ref-tasks-package` task changed.
+
+      The reason for this change can be many. To understand why the hash of the
+      :ref:`ref-tasks-package` task changed, you can run the following command:
+
+      .. code-block:: console
+
+         $ bitbake-diffsigs -t hello-world package
 
 -  If PR Service is not enabled, the build system replaces the
    ``AUTOINC`` placeholder with zero (i.e. "0"). This results in
Signature · 1 line
2.52.0
#2 lore raw

PATCH v2 2/3 dev-manual/packages.rst: rename r0.0 to r0 when PR server is not enabled

In reply to Antonin Godard

When we don't have a PR server enabled, we don't have leading ".0" to the PKGR variable, as this is added by the PR server.

---
 documentation/dev-manual/packages.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
documentation/dev-manual/packages.rst +2 -2
index 86a569b67..383c93131 100644
@@ -300,8 +300,8 @@ with a number. The number used depends on the state of the PR Service:
 
    .. code-block:: none
 
-      hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
-      hello-world-git_0.0+git0+dd2f5c3565-r0.0_armv7a-neon.ipk
+      hello-world-git_0.0+git0+b6558dd387-r0_armv7a-neon.ipk
+      hello-world-git_0.0+git0+dd2f5c3565-r0_armv7a-neon.ipk
 
 In summary, the OpenEmbedded build system does not track the history of
 binary package versions for this purpose. ``AUTOINC``, in this case, is
Signature · 1 line
2.52.0
#3 lore raw

PATCH v2 3/3 dev-manual/packages.rst: fix example recipe version

In reply to Antonin Godard

The example recipe taken above is hello-world on version 1.0 (because PV equals "1.0+git". Fix this issue.

---
 documentation/dev-manual/packages.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
documentation/dev-manual/packages.rst +4 -4
index 383c93131..6b4a3b81a 100644
@@ -274,8 +274,8 @@ with a number. The number used depends on the state of the PR Service:
 
    .. code-block:: none
 
-      hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
-      hello-world-git_0.0+git1+dd2f5c3565-r0.1_armv7a-neon.ipk
+      hello-world-git_1.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
+      hello-world-git_1.0+git1+dd2f5c3565-r0.1_armv7a-neon.ipk
 
    Two numbers got incremented here:
 
@@ -300,8 +300,8 @@ with a number. The number used depends on the state of the PR Service:
 
    .. code-block:: none
 
-      hello-world-git_0.0+git0+b6558dd387-r0_armv7a-neon.ipk
-      hello-world-git_0.0+git0+dd2f5c3565-r0_armv7a-neon.ipk
+      hello-world-git_1.0+git0+b6558dd387-r0_armv7a-neon.ipk
+      hello-world-git_1.0+git0+dd2f5c3565-r0_armv7a-neon.ipk
 
 In summary, the OpenEmbedded build system does not track the history of
 binary package versions for this purpose. ``AUTOINC``, in this case, is
Signature · 1 line
2.52.0
author Applied
#4 lore raw
In reply to Antonin Godard

Applied, thanks!

[1/3] dev-manual/packages.rst: pr server: fix and explain why r0.X increments on SRCREV change

      commit: 09f0430bc69024b9854c31ba6783ddd807aa4f19
[2/3] dev-manual/packages.rst: rename r0.0 to r0 when PR server is not enabled
      commit: 7a0324b6a10e64ee250945747db10ca88040b1ce
[3/3] dev-manual/packages.rst: fix example recipe version
      commit: 411122812ced4ec32127a823896a73aacf6eb97c