From: Quentin Schulz <quentin.schulz@cherry.de>
To: corentin.guillevic@smile.fr, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] sanity: add check for own-mirrors/SOURCE_MIRROR_URL
Date: Fri, 17 Apr 2026 19:16:37 +0200 [thread overview]
Message-ID: <cbbd5375-bb36-41df-8ef8-5d0a2ffcf5fc@cherry.de> (raw)
In-Reply-To: <20260417160925.339720-1-corentin.guillevic@smile.fr>
Hi Corentin,
On 4/17/26 6:09 PM, 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>
> ---
> meta/classes-global/sanity.bbclass | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
> index 1a490f8d61..b24cec7f2c 100644
> --- a/meta/classes-global/sanity.bbclass
> +++ b/meta/classes-global/sanity.bbclass
> @@ -984,6 +984,11 @@ 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
> + inheritlist = d.getVar('INHERIT')
> + if "own-mirrors" in inheritlist.split(" ") and not d.getVar('SOURCE_MIRROR_URL'):
We have oe.utils.inherits(d, <classes>), I'm wondering if we can use
that instead?
> + bb.fatal("own-mirrors is enabled, but SOURCE_MIRROR_URL is not defined")
We don't have any bb.fatal in that function, only bb.warn,
status.addresult() and raise_sanity_error, so we probably should use one
of those.
Cheers,
Quentin
prev parent reply other threads:[~2026-04-17 17:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 16:09 [PATCH] sanity: add check for own-mirrors/SOURCE_MIRROR_URL corentin.guillevic
2026-04-17 17:16 ` Quentin Schulz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cbbd5375-bb36-41df-8ef8-5d0a2ffcf5fc@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=corentin.guillevic@smile.fr \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox