public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Schmidt, Adriaan" <adriaan.schmidt@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "MOESSBAUER, Felix" <felix.moessbauer@siemens.com>
Subject: RE: [PATCH v2 4/4] multiarch: Fix SRC_URI:remove ignoring
Date: Thu, 14 Mar 2024 08:28:08 +0000	[thread overview]
Message-ID: <AS4PR10MB531848BD26B9D196F24E7F3DED292@AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240216141051.3490109-5-amikan@ilbers.de>

Anton Mikanovich, Friday, February 16, 2024 3:11 PM:
> Setting SRC_URI right after getVar with expand=False results in loosing
> SRC_URI:remove values. Rebuild logic to use remove-append approach.
> 
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  meta/classes/multiarch.bbclass | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
> index 48cec9ab..b3fc9441 100644
> --- a/meta/classes/multiarch.bbclass
> +++ b/meta/classes/multiarch.bbclass
> @@ -49,8 +49,9 @@ python multiarch_virtclass_handler() {
>          vars = 'SRC_URI FILESPATH'.split()
>          for var in vars:
>              v = d.getVar(var, expand=False)
> -            if v is not None:
> -                d.setVar(var, v.replace('${PN}', '${BPN}'))
> +            if v is not None and '${PN}' in v:
> +                d.setVar(var + ':remove', v)
> +                d.appendVar(var, v.replace('${PN}', '${BPN}'))

Hi Anton,

Just stumbled across this when using current next:
There is a space missing in the append:
d.appendVar(var, ' ' + v.replace('${PN}', '${BPN}'))

Also, setting variables "V:remove" (potentially multiple times) from
Python code smells a little funny. I'm not sure about Bitbake parsing,
and the order of execution-of-Python-blocks vs. variable-assignments vs.
expansions vs. :remove-operators, but I'm a worried that this might
be relying on some undocumented implementation details and only work
by accident.
But I admit that I didn't have a closer look at the actual problem
you're solving here, so I also don't have a good alternative proposal.

So for now, I'd suggest to just fix the missing space.

Thanks,
Adriaan

> 
>      # When building compat/native, the corresponding suffix needs to be
>      # propagated to all bitbake dependency definitions.
> --
> 2.34.1
> 
> --
> 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/20240216141051.3490109-5-
> amikan%40ilbers.de.

  reply	other threads:[~2024-03-14  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 14:10 [PATCH v2 0/4] " Anton Mikanovich
2024-02-16 14:10 ` [PATCH v2 1/4] conf: Enable bbappends Anton Mikanovich
2024-02-16 14:10 ` [PATCH v2 2/4] meta-test: Add examples of SRC_URI overrides usage Anton Mikanovich
2024-02-16 14:10 ` [PATCH v2 3/4] dpkg-base: Fix SRC_URI:remove ignoring Anton Mikanovich
2024-02-16 14:10 ` [PATCH v2 4/4] multiarch: " Anton Mikanovich
2024-03-14  8:28   ` Schmidt, Adriaan [this message]
2024-03-14  8:44     ` Anton Mikanovich
2024-02-19 18:19 ` [PATCH v2 0/4] " Jan Kiszka
2024-03-07  7:15 ` Uladzimir Bely

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=AS4PR10MB531848BD26B9D196F24E7F3DED292@AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM \
    --to=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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