public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL
@ 2026-04-20 14:31 corentin.guillevic
  2026-04-20 14:42 ` [OE-core] " Antonin Godard
  0 siblings, 1 reply; 4+ messages in thread
From: corentin.guillevic @ 2026-04-20 14:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Corentin Guillevic

From: Corentin Guillevic <corentin.guillevic@smile.fr>

The SOURCE_MIRROR_URL variable belongs to the own-mirrors class. However, the
user may forget to define it. This will cause the class to inject incorrect
content into PREMIRRORS, resulting in the following error:

ERROR: gettext-minimal-native-1.0-r0 do_fetch: Bitbake Fetcher Error: MalformedUrl('${SOURCE_MIRROR_URL}')
ERROR: Logfile of failure stored in: /path/to/tmp/work/x86_64-linux/gettext-minimal-native/1.0/temp/log.do_fetch.258066
ERROR: Task (/path/to/layers/poky/meta/recipes-core/gettext/gettext-minimal-native_1.0.bb:do_fetch) failed with exit code '1'

Add a check to the sanity class, to detect this case and raise an error.

Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
---

Notes:
    Changes in v3:
    - Unused variable removed.

 meta/classes-global/sanity.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index 1a490f8d61..3142ff61f2 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -984,6 +984,10 @@ def check_sanity_everybuild(status, d):
             "Please set TMPDIR to a clean path with no trailing slash or "
             "consecutive slashes (e.g. %s).\n" % (tmpdir, os.path.normpath(tmpdir)))
 
+    # Check whether the SOURCE_MIRROR_URL variable, belonging to the 'own-mirrors' class, is defined
+    if oe.utils.inherits(d, 'own-mirrors') and not d.getVar('SOURCE_MIRROR_URL'):
+        status.addresult("own-mirrors is enabled, but SOURCE_MIRROR_URL is not defined")
+
     # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
     import re
     mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
-- 
2.51.0



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

* Re: [OE-core] [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL
  2026-04-20 14:31 [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL corentin.guillevic
@ 2026-04-20 14:42 ` Antonin Godard
  2026-04-22  9:32   ` Corentin GUILLEVIC
  0 siblings, 1 reply; 4+ messages in thread
From: Antonin Godard @ 2026-04-20 14:42 UTC (permalink / raw)
  To: corentin.guillevic, openembedded-core

On Mon Apr 20, 2026 at 4:31 PM CEST, Corentin Guillevic via lists.openembedded.org wrote:
> From: Corentin Guillevic <corentin.guillevic@smile.fr>
>
> The SOURCE_MIRROR_URL variable belongs to the own-mirrors class. However, the
> user may forget to define it. This will cause the class to inject incorrect
> content into PREMIRRORS, resulting in the following error:
>
> ERROR: gettext-minimal-native-1.0-r0 do_fetch: Bitbake Fetcher Error: MalformedUrl('${SOURCE_MIRROR_URL}')
> ERROR: Logfile of failure stored in: /path/to/tmp/work/x86_64-linux/gettext-minimal-native/1.0/temp/log.do_fetch.258066
> ERROR: Task (/path/to/layers/poky/meta/recipes-core/gettext/gettext-minimal-native_1.0.bb:do_fetch) failed with exit code '1'
>
> Add a check to the sanity class, to detect this case and raise an error.
>
> Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
> ---
>
> Notes:
>     Changes in v3:
>     - Unused variable removed.
>
>  meta/classes-global/sanity.bbclass | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
> index 1a490f8d61..3142ff61f2 100644
> --- a/meta/classes-global/sanity.bbclass
> +++ b/meta/classes-global/sanity.bbclass
> @@ -984,6 +984,10 @@ def check_sanity_everybuild(status, d):
>              "Please set TMPDIR to a clean path with no trailing slash or "
>              "consecutive slashes (e.g. %s).\n" % (tmpdir, os.path.normpath(tmpdir)))
>  
> +    # Check whether the SOURCE_MIRROR_URL variable, belonging to the 'own-mirrors' class, is defined
> +    if oe.utils.inherits(d, 'own-mirrors') and not d.getVar('SOURCE_MIRROR_URL'):
> +        status.addresult("own-mirrors is enabled, but SOURCE_MIRROR_URL is not defined")
> +
>      # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
>      import re
>      mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']

Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>

This should be added to
https://git.yoctoproject.org/yocto-docs/tree/documentation/ref-manual/qa-checks.rst
if merged and if you have some time and can send a patch to docs@lists.yoctoproject.org :)

Thanks,
Antonin


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

* Re: [OE-core] [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL
  2026-04-20 14:42 ` [OE-core] " Antonin Godard
@ 2026-04-22  9:32   ` Corentin GUILLEVIC
  2026-04-22 10:48     ` Antonin Godard
  0 siblings, 1 reply; 4+ messages in thread
From: Corentin GUILLEVIC @ 2026-04-22  9:32 UTC (permalink / raw)
  To: Antonin Godard; +Cc: openembedded-core

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

Hi Antonin,

Sure, but my test has been added to the sanity class. The
https://git.yoctoproject.org/yocto-docs/tree/documentation/ref-manual/qa-checks.rst
doc
is related to the insane class. Is there a document relating to the sanity
class in which I can document the new test?

Corentin

Le lun. 20 avr. 2026 à 16:42, Antonin Godard <antonin.godard@bootlin.com> a
écrit :

> On Mon Apr 20, 2026 at 4:31 PM CEST, Corentin Guillevic via
> lists.openembedded.org wrote:
> > From: Corentin Guillevic <corentin.guillevic@smile.fr>
> >
> > The SOURCE_MIRROR_URL variable belongs to the own-mirrors class.
> However, the
> > user may forget to define it. This will cause the class to inject
> incorrect
> > content into PREMIRRORS, resulting in the following error:
> >
> > ERROR: gettext-minimal-native-1.0-r0 do_fetch: Bitbake Fetcher Error:
> MalformedUrl('${SOURCE_MIRROR_URL}')
> > ERROR: Logfile of failure stored in:
> /path/to/tmp/work/x86_64-linux/gettext-minimal-native/1.0/temp/log.do_fetch.258066
> > ERROR: Task
> (/path/to/layers/poky/meta/recipes-core/gettext/gettext-minimal-native_1.0.bb:do_fetch)
> failed with exit code '1'
> >
> > Add a check to the sanity class, to detect this case and raise an error.
> >
> > Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
> > ---
> >
> > Notes:
> >     Changes in v3:
> >     - Unused variable removed.
> >
> >  meta/classes-global/sanity.bbclass | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/meta/classes-global/sanity.bbclass
> b/meta/classes-global/sanity.bbclass
> > index 1a490f8d61..3142ff61f2 100644
> > --- a/meta/classes-global/sanity.bbclass
> > +++ b/meta/classes-global/sanity.bbclass
> > @@ -984,6 +984,10 @@ def check_sanity_everybuild(status, d):
> >              "Please set TMPDIR to a clean path with no trailing slash
> or "
> >              "consecutive slashes (e.g. %s).\n" % (tmpdir,
> os.path.normpath(tmpdir)))
> >
> > +    # Check whether the SOURCE_MIRROR_URL variable, belonging to the
> 'own-mirrors' class, is defined
> > +    if oe.utils.inherits(d, 'own-mirrors') and not
> d.getVar('SOURCE_MIRROR_URL'):
> > +        status.addresult("own-mirrors is enabled, but SOURCE_MIRROR_URL
> is not defined")
> > +
> >      # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
> >      import re
> >      mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
>
> Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
>
> This should be added to
>
> https://git.yoctoproject.org/yocto-docs/tree/documentation/ref-manual/qa-checks.rst
> if merged and if you have some time and can send a patch to
> docs@lists.yoctoproject.org :)
>
> Thanks,
> Antonin
>

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

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

* Re: [OE-core] [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL
  2026-04-22  9:32   ` Corentin GUILLEVIC
@ 2026-04-22 10:48     ` Antonin Godard
  0 siblings, 0 replies; 4+ messages in thread
From: Antonin Godard @ 2026-04-22 10:48 UTC (permalink / raw)
  To: corentin.guillevic; +Cc: openembedded-core

Hi,

On Wed Apr 22, 2026 at 11:32 AM CEST, Corentin Guillevic via lists.openembedded.org wrote:
> Hi Antonin,
>
> Sure, but my test has been added to the sanity class. The
> https://git.yoctoproject.org/yocto-docs/tree/documentation/ref-manual/qa-checks.rst
> doc
> is related to the insane class. Is there a document relating to the sanity
> class in which I can document the new test?

Ah you're right sorry, I keep mixing them up. Ignore my comment then, there's no
docs about all sanity.bbclass checks I think.

Thanks,
Antonin


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

end of thread, other threads:[~2026-04-22 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 14:31 [PATCH v3] sanity: add check for own-mirrors/SOURCE_MIRROR_URL corentin.guillevic
2026-04-20 14:42 ` [OE-core] " Antonin Godard
2026-04-22  9:32   ` Corentin GUILLEVIC
2026-04-22 10:48     ` Antonin Godard

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