diff mbox series

meta/lib/oe/recipeutils.py: Handle multi-repo recipes for upgrade check

Message ID 20250923154701.1506704-2-u.kleine-koenig@baylibre.com
State Accepted, archived
Commit ddf00d6aee955878c070327ee8d751fdb6099444
Headers show
Series meta/lib/oe/recipeutils.py: Handle multi-repo recipes for upgrade check | expand

Commit Message

Uwe Kleine-König Sept. 23, 2025, 3:47 p.m. UTC
For a recipe that uses more than one git repo there isn't a single
SRCREV variable. For example for linux-yocto there is SRCREV_machine and
SRCREV_meta and rd.getVar("SRCREV") yields "INVALID".

Luckily bb.fetch2 already handles all the details and exposes the
currently used revision in ud. So just use that.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

note this is my first OpenEmbedded-Core patch, so please apply some
extra caution before applying this patch.

Note that for testing with linux-yocto I also set

	UPSTREAM_CHECK_COMMITS = "1"

for that recipe. (I'm not sure this is completely right to do in
general, but that's a separate discussion. Without it `devtool
check-upgrade-status linux-yocto` suggested to go to 6.16.y instead of
6.12.$latest.)

Best regards
Uwe

 meta/lib/oe/recipeutils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: e90bc48bdaa2234cad52bbb2800f5246c277ffbd

Comments

Uwe Kleine-König Oct. 2, 2025, 9:48 a.m. UTC | #1
Hello,

On Tue, Sep 23, 2025 at 05:47:02PM +0200, Uwe Kleine-König wrote:
> For a recipe that uses more than one git repo there isn't a single
> SRCREV variable. For example for linux-yocto there is SRCREV_machine and
> SRCREV_meta and rd.getVar("SRCREV") yields "INVALID".
> 
> Luckily bb.fetch2 already handles all the details and exposes the
> currently used revision in ud. So just use that.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> Hello,
> 
> note this is my first OpenEmbedded-Core patch, so please apply some
> extra caution before applying this patch.
> 
> Note that for testing with linux-yocto I also set
> 
> 	UPSTREAM_CHECK_COMMITS = "1"
> 
> for that recipe. (I'm not sure this is completely right to do in
> general, but that's a separate discussion. Without it `devtool
> check-upgrade-status linux-yocto` suggested to go to 6.16.y instead of
> 6.12.$latest.)

This patch was applied to oe-core/master as
ddf00d6aee955878c070327ee8d751fdb6099444 (and cherry-picked to poky as
441313eecbd45cfcbf0368e4d1d54bd2e9e59c6b). Would you consider that a fix
enough to backport it to walnascar and scarthgap, too?

For walnascar it can be cleanly cherry picked. For scarthgap I
additionally need:

-            revision = ud.method.latest_revision(ud, rd, 'default')
+            revision = ud.method.latest_revision(ud, rd, ud.names[0])

I don't understand that completely yet, bisecting points at
6dea2e6332835bd7b646a520e28ce840f0d98f24.

Best regards
Uwe
Gyorgy Sarvari Oct. 2, 2025, 5:25 p.m. UTC | #2
On 10/2/25 11:48, Uwe Kleine-König via lists.openembedded.org wrote:
> Hello,
>
> On Tue, Sep 23, 2025 at 05:47:02PM +0200, Uwe Kleine-König wrote:
>> For a recipe that uses more than one git repo there isn't a single
>> SRCREV variable. For example for linux-yocto there is SRCREV_machine and
>> SRCREV_meta and rd.getVar("SRCREV") yields "INVALID".
>>
>> Luckily bb.fetch2 already handles all the details and exposes the
>> currently used revision in ud. So just use that.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
>> ---
>> Hello,
>>
>> note this is my first OpenEmbedded-Core patch, so please apply some
>> extra caution before applying this patch.
>>
>> Note that for testing with linux-yocto I also set
>>
>> 	UPSTREAM_CHECK_COMMITS = "1"
>>
>> for that recipe. (I'm not sure this is completely right to do in
>> general, but that's a separate discussion. Without it `devtool
>> check-upgrade-status linux-yocto` suggested to go to 6.16.y instead of
>> 6.12.$latest.)
> This patch was applied to oe-core/master as
> ddf00d6aee955878c070327ee8d751fdb6099444 (and cherry-picked to poky as
> 441313eecbd45cfcbf0368e4d1d54bd2e9e59c6b). Would you consider that a fix
> enough to backport it to walnascar and scarthgap, too?

It is most likely too late for Walnascar - there is only one more
release planned, and it is already in QA phase.
Scarthgap is however very much alive - you can rebase your patch on top
of the latest Scarthgap branch, and send it with the appropriate subject[1]

[1]:
https://docs.yoctoproject.org/dev/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches

> For walnascar it can be cleanly cherry picked. For scarthgap I
> additionally need:
>
> -            revision = ud.method.latest_revision(ud, rd, 'default')
> +            revision = ud.method.latest_revision(ud, rd, ud.names[0])
>
> I don't understand that completely yet, bisecting points at
> 6dea2e6332835bd7b646a520e28ce840f0d98f24.
>
> Best regards
> Uwe
>
Uwe Kleine-König Oct. 2, 2025, 10:13 p.m. UTC | #3
Hello Gyorgy,

On Thu, Oct 02, 2025 at 07:25:49PM +0200, Gyorgy Sarvari wrote:
> On 10/2/25 11:48, Uwe Kleine-König via lists.openembedded.org wrote:
> > This patch was applied to oe-core/master as
> > ddf00d6aee955878c070327ee8d751fdb6099444 (and cherry-picked to poky as
> > 441313eecbd45cfcbf0368e4d1d54bd2e9e59c6b). Would you consider that a fix
> > enough to backport it to walnascar and scarthgap, too?
> 
> It is most likely too late for Walnascar - there is only one more
> release planned, and it is already in QA phase.
> Scarthgap is however very much alive - you can rebase your patch on top
> of the latest Scarthgap branch, and send it with the appropriate subject[1]

That's fine for me. I care about Scarthgap and expected that I'm
not allowed to get anything into that in which isn't in Walnascar.

> > For walnascar it can be cleanly cherry picked. For scarthgap I
> > additionally need:
> >
> > -            revision = ud.method.latest_revision(ud, rd, 'default')
> > +            revision = ud.method.latest_revision(ud, rd, ud.names[0])
> >
> > I don't understand that completely yet, bisecting points at
> > 6dea2e6332835bd7b646a520e28ce840f0d98f24.

6dea2e6332835bd7b646a520e28ce840f0d98f24 looks very unsuspicious. I
understood where I did the bisection wrong. Once I understood the need
for the additional changed line I'll send a patch for Scarthgap (with
the correct marker in the Subject).

Thanks
Uwe
diff mbox series

Patch

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 044f1bfa6140..102789ce735a 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -1075,7 +1075,7 @@  def get_recipe_upstream_version(rd):
             try:
                 revision = ud.method.latest_revision(ud, rd, 'default')
                 upversion = pv
-                if revision != rd.getVar("SRCREV"):
+                if revision != ud.revision:
                     upversion = upversion + "-new-commits-available"
             except bb.fetch2.FetchError as e:
                 bb.warn("Unable to obtain latest revision: {}".format(e))