public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
@ 2023-04-12 10:17 Srinuvasan Arjunan
  2023-04-13  7:02 ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-12 10:17 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
the latest changes always, but this not works after bitbake 2 migration,
it throws the below error.

do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).

Till now we don't have support for SRCPV in ISAR, hence add this support
as like OE.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/base.bbclass | 2 ++
 meta/conf/bitbake.conf    | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 53550ae..cc2b195 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -120,6 +120,8 @@ root_cleandirs() {
 python() {
     import re
 
+    d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+
     for e in d.keys():
         flags = d.getVarFlags(e)
         if flags and flags.get('task'):
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f421050..124bf49 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
 AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV[vardepvalue] = "${SRCPV}"
+# Set Dynamically in base.bbclass
+# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
 SRC_URI = ""
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-12 10:17 [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV Srinuvasan Arjunan
@ 2023-04-13  7:02 ` Jan Kiszka
  2023-04-13  7:09   ` Srinuvasan Arjunan
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2023-04-13  7:02 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users

On 12.04.23 12:17, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> the latest changes always, but this not works after bitbake 2 migration,
> it throws the below error.
> 
> do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
> 
> Till now we don't have support for SRCPV in ISAR, hence add this support
> as like OE.
> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/base.bbclass | 2 ++
>  meta/conf/bitbake.conf    | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 53550ae..cc2b195 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -120,6 +120,8 @@ root_cleandirs() {
>  python() {
>      import re
>  
> +    d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> +

This is likely not correct. OE upstream checks if there is any SCM in
the SRC_URI entries and only then adds this. I've played with
unconditionally adding SRCPV (though via bitbake.conf), and I got errors.

Jan

>      for e in d.keys():
>          flags = d.getVarFlags(e)
>          if flags and flags.get('task'):
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index f421050..124bf49 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>  PROVIDES = ""
>  S = "${WORKDIR}/${P}"
>  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> +AUTOREV[vardepvalue] = "${SRCPV}"
> +# Set Dynamically in base.bbclass
> +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> +SRCPV[vardepvalue] = "${SRCPV}"
>  SRC_URI = ""
>  STAMPS_DIR ?= "${TMPDIR}/stamps"
>  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-13  7:02 ` Jan Kiszka
@ 2023-04-13  7:09   ` Srinuvasan Arjunan
  2023-04-14  8:57     ` Srinuvasan Arjunan
  0 siblings, 1 reply; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-13  7:09 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Srinuvasan Arjunan, isar-users

[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]

On Thu, Apr 13, 2023 at 12:32 PM 'Jan Kiszka' via isar-users <
isar-users@googlegroups.com> wrote:

> On 12.04.23 12:17, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuvasan_a@mentor.com>
> >
> > One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> > the latest changes always, but this not works after bitbake 2 migration,
> > it throws the below error.
> >
> > do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a
> fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for
> OE).
> >
> > Till now we don't have support for SRCPV in ISAR, hence add this support
> > as like OE.
> >
> > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> > ---
> >  meta/classes/base.bbclass | 2 ++
> >  meta/conf/bitbake.conf    | 4 ++++
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> > index 53550ae..cc2b195 100644
> > --- a/meta/classes/base.bbclass
> > +++ b/meta/classes/base.bbclass
> > @@ -120,6 +120,8 @@ root_cleandirs() {
> >  python() {
> >      import re
> >
> > +    d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> > +
>
> This is likely not correct. OE upstream checks if there is any SCM in
> the SRC_URI entries and only then adds this. I've played with
> unconditionally adding SRCPV (though via bitbake.conf), and I got errors.
>
> Jan
>

    Sure jan, will check and send the next version.

>
> >      for e in d.keys():
> >          flags = d.getVarFlags(e)
> >          if flags and flags.get('task'):
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index f421050..124bf49 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE',
> False),d)[2] or 'r0'}"
> >  PROVIDES = ""
> >  S = "${WORKDIR}/${P}"
> >  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> > +AUTOREV[vardepvalue] = "${SRCPV}"
> > +# Set Dynamically in base.bbclass
> > +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> > +SRCPV[vardepvalue] = "${SRCPV}"
> >  SRC_URI = ""
> >  STAMPS_DIR ?= "${TMPDIR}/stamps"
> >  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
>
> --
> Siemens AG, Technology
> Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/1e8a8cb1-68e6-be14-0d42-13a8a5ff1dea%40siemens.com
> .
>

[-- Attachment #2: Type: text/html, Size: 4001 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-13  7:09   ` Srinuvasan Arjunan
@ 2023-04-14  8:57     ` Srinuvasan Arjunan
  2023-04-14  9:00       ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-14  8:57 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
the latest changes always, but this not works after bitbake 2 migration,
it throws the below error.

do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).

Till now we don't have support for SRCPV in ISAR, hence add this support
as like OE.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/base.bbclass | 4 ++++
 meta/conf/bitbake.conf    | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 53550ae..819f8a2 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -120,6 +120,10 @@ root_cleandirs() {
 python() {
     import re
 
+    srcuri = d.getVar('SRC_URI')
+    if srcuri:
+        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+
     for e in d.keys():
         flags = d.getVarFlags(e)
         if flags and flags.get('task'):
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f421050..124bf49 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
 AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV[vardepvalue] = "${SRCPV}"
+# Set Dynamically in base.bbclass
+# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
 SRC_URI = ""
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-14  8:57     ` Srinuvasan Arjunan
@ 2023-04-14  9:00       ` Jan Kiszka
  2023-04-14  9:12         ` Srinuvasan Arjunan
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2023-04-14  9:00 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users

On 14.04.23 10:57, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> the latest changes always, but this not works after bitbake 2 migration,
> it throws the below error.
> 
> do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
> 
> Till now we don't have support for SRCPV in ISAR, hence add this support
> as like OE.
> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/base.bbclass | 4 ++++
>  meta/conf/bitbake.conf    | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 53550ae..819f8a2 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -120,6 +120,10 @@ root_cleandirs() {
>  python() {
>      import re
>  
> +    srcuri = d.getVar('SRC_URI')
> +    if srcuri:
> +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> +

Still not the logic that OE uses - why?

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-14  9:00       ` Jan Kiszka
@ 2023-04-14  9:12         ` Srinuvasan Arjunan
  2023-04-14  9:16           ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-14  9:12 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Srinuvasan Arjunan, isar-users

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

On Fri, Apr 14, 2023 at 2:30 PM 'Jan Kiszka' via isar-users <
isar-users@googlegroups.com> wrote:

> On 14.04.23 10:57, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuvasan_a@mentor.com>
> >
> > One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> > the latest changes always, but this not works after bitbake 2 migration,
> > it throws the below error.
> >
> > do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a
> fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for
> OE).
> >
> > Till now we don't have support for SRCPV in ISAR, hence add this support
> > as like OE.
> >
> > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> > ---
> >  meta/classes/base.bbclass | 4 ++++
> >  meta/conf/bitbake.conf    | 4 ++++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> > index 53550ae..819f8a2 100644
> > --- a/meta/classes/base.bbclass
> > +++ b/meta/classes/base.bbclass
> > @@ -120,6 +120,10 @@ root_cleandirs() {
> >  python() {
> >      import re
> >
> > +    srcuri = d.getVar('SRC_URI')
> > +    if srcuri:
> > +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> > +
>
> Still not the logic that OE uses - why?
>
> Jan
>

  I thought it would be enable when SRC_URI contains any SCM
  They have a logic like get the uri and validating the uri.scheme against
with many SCM , and set the needsrcrev variable if needed
  f.e : git

if uri.scheme in ("git", "gitsm"):
            needsrcrev = True

 Would we need to check like this?

>
> --
> Siemens AG, Technology
> Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/b58e37e2-00db-d2db-9955-cdcce8ae3f26%40siemens.com
> .
>

[-- Attachment #2: Type: text/html, Size: 4843 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-14  9:12         ` Srinuvasan Arjunan
@ 2023-04-14  9:16           ` Jan Kiszka
  2023-04-17 13:27             ` Srinuvasan Arjunan
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2023-04-14  9:16 UTC (permalink / raw)
  To: Srinuvasan Arjunan; +Cc: Srinuvasan Arjunan, isar-users

On 14.04.23 11:12, Srinuvasan Arjunan wrote:
> 
> 
> On Fri, Apr 14, 2023 at 2:30 PM 'Jan Kiszka' via isar-users
> <isar-users@googlegroups.com <mailto:isar-users@googlegroups.com>> wrote:
> 
>     On 14.04.23 10:57, Srinuvasan Arjunan wrote:
>     > From: Srinuvasan A <srinuvasan_a@mentor.com
>     <mailto:srinuvasan_a@mentor.com>>
>     >
>     > One of our downstream project recipe uses `SRCREV = "${AUTOREV}"`
>     to get
>     > the latest changes always, but this not works after bitbake 2
>     migration,
>     > it throws the below error.
>     >
>     > do_fetch: Fetcher failure: Recipe uses a floating tag/branch
>     without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use
>     SRCPV in PV for OE).
>     >
>     > Till now we don't have support for SRCPV in ISAR, hence add this
>     support
>     > as like OE.
>     >
>     > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com
>     <mailto:srinuvasan_a@mentor.com>>
>     > ---
>     >  meta/classes/base.bbclass | 4 ++++
>     >  meta/conf/bitbake.conf    | 4 ++++
>     >  2 files changed, 8 insertions(+)
>     >
>     > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>     > index 53550ae..819f8a2 100644
>     > --- a/meta/classes/base.bbclass
>     > +++ b/meta/classes/base.bbclass
>     > @@ -120,6 +120,10 @@ root_cleandirs() {
>     >  python() {
>     >      import re
>     > 
>     > +    srcuri = d.getVar('SRC_URI')
>     > +    if srcuri:
>     > +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
>     > +
> 
>     Still not the logic that OE uses - why?
> 
>     Jan
> 
>  
>   I thought it would be enable when SRC_URI contains any SCM
>   They have a logic like get the uri and validating the uri.scheme
> against with many SCM , and set the needsrcrev variable if needed
>   f.e : git
>  
> if uri.scheme in ("git", "gitsm"):
>             needsrcrev = True
> 	
> 
>  Would we need to check like this?
> 

Counter question: Does your solution also work if SRC_URI is only
containing "file://"?

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-14  9:16           ` Jan Kiszka
@ 2023-04-17 13:27             ` Srinuvasan Arjunan
  2023-04-17 14:10               ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-17 13:27 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
the latest changes always, but this not works after bitbake 2 migration,
it throws the below error.

do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).

Till now we don't have support for SRCPV in ISAR, hence add this support
as like OE.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/base.bbclass | 26 ++++++++++++++++++++++++++
 meta/conf/bitbake.conf    |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 53550ae..f631483 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -120,6 +120,32 @@ root_cleandirs() {
 python() {
     import re
 
+    needsrcrev = False
+    srcuri = d.getVar('SRC_URI')
+    for uri_string in srcuri.split():
+        uri = bb.fetch.URI(uri_string)
+        # Svn packages should DEPEND on subversion-native
+        if uri.scheme == "svn":
+            needsrcrev = True
+
+        # Git packages should DEPEND on git-native
+        elif uri.scheme in ("git", "gitsm"):
+            needsrcrev = True
+
+        # Mercurial packages should DEPEND on mercurial-native
+        elif uri.scheme == "hg":
+            needsrcrev = True
+
+        # Perforce packages support SRCREV = "${AUTOREV}"
+        elif uri.scheme == "p4":
+            needsrcrev = True
+
+        elif uri.scheme == "repo":
+            needsrcrev = True
+
+    if needsrcrev:
+        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+
     for e in d.keys():
         flags = d.getVarFlags(e)
         if flags and flags.get('task'):
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f421050..124bf49 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
 AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV[vardepvalue] = "${SRCPV}"
+# Set Dynamically in base.bbclass
+# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
 SRC_URI = ""
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-17 13:27             ` Srinuvasan Arjunan
@ 2023-04-17 14:10               ` Jan Kiszka
  2023-04-18  6:25                 ` Srinuvasan Arjunan
  2023-04-18  7:06                 ` Uladzimir Bely
  0 siblings, 2 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-04-17 14:10 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users

Make sure to always version your patches!

On 17.04.23 15:27, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> the latest changes always, but this not works after bitbake 2 migration,
> it throws the below error.
> 
> do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
> 
> Till now we don't have support for SRCPV in ISAR, hence add this support
> as like OE.
> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/base.bbclass | 26 ++++++++++++++++++++++++++
>  meta/conf/bitbake.conf    |  4 ++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 53550ae..f631483 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -120,6 +120,32 @@ root_cleandirs() {
>  python() {
>      import re
>  
> +    needsrcrev = False
> +    srcuri = d.getVar('SRC_URI')
> +    for uri_string in srcuri.split():
> +        uri = bb.fetch.URI(uri_string)
> +        # Svn packages should DEPEND on subversion-native

The comments is not fully accurate for Isar (we are not building such
tools natively). Same below.

> +        if uri.scheme == "svn":
> +            needsrcrev = True
> +
> +        # Git packages should DEPEND on git-native
> +        elif uri.scheme in ("git", "gitsm"):
> +            needsrcrev = True
> +
> +        # Mercurial packages should DEPEND on mercurial-native
> +        elif uri.scheme == "hg":
> +            needsrcrev = True
> +
> +        # Perforce packages support SRCREV = "${AUTOREV}"
> +        elif uri.scheme == "p4":
> +            needsrcrev = True
> +
> +        elif uri.scheme == "repo":
> +            needsrcrev = True
> +
> +    if needsrcrev:
> +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> +
>      for e in d.keys():
>          flags = d.getVarFlags(e)
>          if flags and flags.get('task'):
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index f421050..124bf49 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>  PROVIDES = ""
>  S = "${WORKDIR}/${P}"
>  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> +AUTOREV[vardepvalue] = "${SRCPV}"
> +# Set Dynamically in base.bbclass
> +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> +SRCPV[vardepvalue] = "${SRCPV}"
>  SRC_URI = ""
>  STAMPS_DIR ?= "${TMPDIR}/stamps"
>  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"

Except for the comments, this looks good to me now.

Just wondering if we could somehow stress this path in Isar upstream as
well - though that should not block this fix for AUTOREV.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-17 14:10               ` Jan Kiszka
@ 2023-04-18  6:25                 ` Srinuvasan Arjunan
  2023-04-18  7:06                 ` Uladzimir Bely
  1 sibling, 0 replies; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-18  6:25 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Srinuvasan Arjunan, isar-users

[-- Attachment #1: Type: text/plain, Size: 3884 bytes --]

On Mon, Apr 17, 2023 at 7:40 PM 'Jan Kiszka' via isar-users <
isar-users@googlegroups.com> wrote:

> Make sure to always version your patches!
>
> On 17.04.23 15:27, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuvasan_a@mentor.com>
> >
> > One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> > the latest changes always, but this not works after bitbake 2 migration,
> > it throws the below error.
> >
> > do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a
> fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for
> OE).
> >
> > Till now we don't have support for SRCPV in ISAR, hence add this support
> > as like OE.
> >
> > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> > ---
> >  meta/classes/base.bbclass | 26 ++++++++++++++++++++++++++
> >  meta/conf/bitbake.conf    |  4 ++++
> >  2 files changed, 30 insertions(+)
> >
> > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> > index 53550ae..f631483 100644
> > --- a/meta/classes/base.bbclass
> > +++ b/meta/classes/base.bbclass
> > @@ -120,6 +120,32 @@ root_cleandirs() {
> >  python() {
> >      import re
> >
> > +    needsrcrev = False
> > +    srcuri = d.getVar('SRC_URI')
> > +    for uri_string in srcuri.split():
> > +        uri = bb.fetch.URI(uri_string)
> > +        # Svn packages should DEPEND on subversion-native
>
> The comments is not fully accurate for Isar (we are not building such
> tools natively). Same below.
>
> > +        if uri.scheme == "svn":
> > +            needsrcrev = True
> > +
> > +        # Git packages should DEPEND on git-native
> > +        elif uri.scheme in ("git", "gitsm"):
> > +            needsrcrev = True
> > +
> > +        # Mercurial packages should DEPEND on mercurial-native
> > +        elif uri.scheme == "hg":
> > +            needsrcrev = True
> > +
> > +        # Perforce packages support SRCREV = "${AUTOREV}"
> > +        elif uri.scheme == "p4":
> > +            needsrcrev = True
> > +
> > +        elif uri.scheme == "repo":
> > +            needsrcrev = True
> > +
> > +    if needsrcrev:
> > +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> > +
> >      for e in d.keys():
> >          flags = d.getVarFlags(e)
> >          if flags and flags.get('task'):
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index f421050..124bf49 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE',
> False),d)[2] or 'r0'}"
> >  PROVIDES = ""
> >  S = "${WORKDIR}/${P}"
> >  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> > +AUTOREV[vardepvalue] = "${SRCPV}"
> > +# Set Dynamically in base.bbclass
> > +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> > +SRCPV[vardepvalue] = "${SRCPV}"
> >  SRC_URI = ""
> >  STAMPS_DIR ?= "${TMPDIR}/stamps"
> >  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
>
> Except for the comments, this looks good to me now.
>
> Just wondering if we could somehow stress this path in Isar upstream as
> well - though that should not block this fix for AUTOREV.
>

    Stress this path meant, this one you are saying
    # Also check downloadfilename as the URL path might not be useful for
sniffing
    path = uri.params.get("downloadfilename", uri.path)

>
> Jan
>
> --
> Siemens AG, Technology
> Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/7c8c6715-0ecd-35ab-4865-9b549f833ccf%40siemens.com
> .
>

[-- Attachment #2: Type: text/html, Size: 5491 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-17 14:10               ` Jan Kiszka
  2023-04-18  6:25                 ` Srinuvasan Arjunan
@ 2023-04-18  7:06                 ` Uladzimir Bely
  2023-04-19  2:40                   ` [PATCH v2] " Srinuvasan Arjunan
  1 sibling, 1 reply; 14+ messages in thread
From: Uladzimir Bely @ 2023-04-18  7:06 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users; +Cc: Jan Kiszka

In the email from Monday, 17 April 2023 17:10:03 +03 user 'Jan Kiszka' via isar-users wrote:
> Make sure to always version your patches!
> 
> On 17.04.23 15:27, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuvasan_a@mentor.com>
> > 
> > One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> > the latest changes always, but this not works after bitbake 2 migration,
> > it throws the below error.
> > 
> > do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
> > 
> > Till now we don't have support for SRCPV in ISAR, hence add this support
> > as like OE.
> > 
> > Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> > ---
> >  meta/classes/base.bbclass | 26 ++++++++++++++++++++++++++
> >  meta/conf/bitbake.conf    |  4 ++++
> >  2 files changed, 30 insertions(+)
> > 
> > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> > index 53550ae..f631483 100644
> > --- a/meta/classes/base.bbclass
> > +++ b/meta/classes/base.bbclass
> > @@ -120,6 +120,32 @@ root_cleandirs() {
> >  python() {
> >      import re
> >  
> > +    needsrcrev = False
> > +    srcuri = d.getVar('SRC_URI')
> > +    for uri_string in srcuri.split():
> > +        uri = bb.fetch.URI(uri_string)
> > +        # Svn packages should DEPEND on subversion-native
> 
> The comments is not fully accurate for Isar (we are not building such
> tools natively). Same below.
> 

If comments below are to be removed, it would be probably better to collapse all the stuff to

if uri.scheme in ("svn", "git", "gitsm", "hg", "p4", "repo"):
    needsrcrev = True


> > +        if uri.scheme == "svn":
> > +            needsrcrev = True
> > +
> > +        # Git packages should DEPEND on git-native
> > +        elif uri.scheme in ("git", "gitsm"):
> > +            needsrcrev = True
> > +
> > +        # Mercurial packages should DEPEND on mercurial-native
> > +        elif uri.scheme == "hg":
> > +            needsrcrev = True
> > +
> > +        # Perforce packages support SRCREV = "${AUTOREV}"
> > +        elif uri.scheme == "p4":
> > +            needsrcrev = True
> > +
> > +        elif uri.scheme == "repo":
> > +            needsrcrev = True
> > +
> > +    if needsrcrev:
> > +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> > +
> >      for e in d.keys():
> >          flags = d.getVarFlags(e)
> >          if flags and flags.get('task'):
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index f421050..124bf49 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> >  PROVIDES = ""
> >  S = "${WORKDIR}/${P}"
> >  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> > +AUTOREV[vardepvalue] = "${SRCPV}"
> > +# Set Dynamically in base.bbclass
> > +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> > +SRCPV[vardepvalue] = "${SRCPV}"
> >  SRC_URI = ""
> >  STAMPS_DIR ?= "${TMPDIR}/stamps"
> >  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
> 
> Except for the comments, this looks good to me now.
> 
> Just wondering if we could somehow stress this path in Isar upstream as
> well - though that should not block this fix for AUTOREV.
> 
> Jan
> 
> 





^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-18  7:06                 ` Uladzimir Bely
@ 2023-04-19  2:40                   ` Srinuvasan Arjunan
  2023-04-19 13:43                     ` Jan Kiszka
  2023-05-08 17:57                     ` Anton Mikanovich
  0 siblings, 2 replies; 14+ messages in thread
From: Srinuvasan Arjunan @ 2023-04-19  2:40 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, ubely, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
the latest changes always, but this not works after bitbake 2 migration,
it throws the below error.

do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).

Till now we don't have support for SRCPV in ISAR, hence add this support
as like OE.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/base.bbclass | 10 ++++++++++
 meta/conf/bitbake.conf    |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 53550ae..17bebe9 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -120,6 +120,16 @@ root_cleandirs() {
 python() {
     import re
 
+    needsrcrev = False
+    srcuri = d.getVar('SRC_URI')
+    for uri_string in srcuri.split():
+        uri = bb.fetch.URI(uri_string)
+        if uri.scheme in ("svn", "git", "gitsm", "hg", "p4", "repo"):
+            needsrcrev = True
+
+    if needsrcrev:
+        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+
     for e in d.keys():
         flags = d.getVarFlags(e)
         if flags and flags.get('task'):
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f421050..124bf49 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PROVIDES = ""
 S = "${WORKDIR}/${P}"
 AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV[vardepvalue] = "${SRCPV}"
+# Set Dynamically in base.bbclass
+# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
 SRC_URI = ""
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-19  2:40                   ` [PATCH v2] " Srinuvasan Arjunan
@ 2023-04-19 13:43                     ` Jan Kiszka
  2023-05-08 17:57                     ` Anton Mikanovich
  1 sibling, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-04-19 13:43 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users; +Cc: ubely

On 19.04.23 04:40, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> the latest changes always, but this not works after bitbake 2 migration,
> it throws the below error.
> 
> do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
> 
> Till now we don't have support for SRCPV in ISAR, hence add this support
> as like OE.
> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/base.bbclass | 10 ++++++++++
>  meta/conf/bitbake.conf    |  4 ++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 53550ae..17bebe9 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -120,6 +120,16 @@ root_cleandirs() {
>  python() {
>      import re
>  
> +    needsrcrev = False
> +    srcuri = d.getVar('SRC_URI')
> +    for uri_string in srcuri.split():
> +        uri = bb.fetch.URI(uri_string)
> +        if uri.scheme in ("svn", "git", "gitsm", "hg", "p4", "repo"):
> +            needsrcrev = True
> +
> +    if needsrcrev:
> +        d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
> +
>      for e in d.keys():
>          flags = d.getVarFlags(e)
>          if flags and flags.get('task'):
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index f421050..124bf49 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -36,6 +36,10 @@ PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>  PROVIDES = ""
>  S = "${WORKDIR}/${P}"
>  AUTOREV = "${@bb.fetch2.get_autorev(d)}"
> +AUTOREV[vardepvalue] = "${SRCPV}"
> +# Set Dynamically in base.bbclass
> +# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
> +SRCPV[vardepvalue] = "${SRCPV}"
>  SRC_URI = ""
>  STAMPS_DIR ?= "${TMPDIR}/stamps"
>  STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"

Looks good to me.

Thanks,
Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV
  2023-04-19  2:40                   ` [PATCH v2] " Srinuvasan Arjunan
  2023-04-19 13:43                     ` Jan Kiszka
@ 2023-05-08 17:57                     ` Anton Mikanovich
  1 sibling, 0 replies; 14+ messages in thread
From: Anton Mikanovich @ 2023-05-08 17:57 UTC (permalink / raw)
  To: Srinuvasan Arjunan, isar-users; +Cc: jan.kiszka, ubely

19/04/2023 05:40, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
>
> One of our downstream project recipe uses `SRCREV = "${AUTOREV}"` to get
> the latest changes always, but this not works after bitbake 2 migration,
> it throws the below error.
>
> do_fetch: Fetcher failure: Recipe uses a floating tag/branch without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE).
>
> Till now we don't have support for SRCPV in ISAR, hence add this support
> as like OE.
>
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>

Applied to next, thanks.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-08 17:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12 10:17 [PATCH] meta/conf/bitbake.conf: enable SRCPV support for AUTOREV Srinuvasan Arjunan
2023-04-13  7:02 ` Jan Kiszka
2023-04-13  7:09   ` Srinuvasan Arjunan
2023-04-14  8:57     ` Srinuvasan Arjunan
2023-04-14  9:00       ` Jan Kiszka
2023-04-14  9:12         ` Srinuvasan Arjunan
2023-04-14  9:16           ` Jan Kiszka
2023-04-17 13:27             ` Srinuvasan Arjunan
2023-04-17 14:10               ` Jan Kiszka
2023-04-18  6:25                 ` Srinuvasan Arjunan
2023-04-18  7:06                 ` Uladzimir Bely
2023-04-19  2:40                   ` [PATCH v2] " Srinuvasan Arjunan
2023-04-19 13:43                     ` Jan Kiszka
2023-05-08 17:57                     ` Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox