public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Srinuvasan Arjunan <srinuvasanasv@gmail.com>
To: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] meta/classes/crossvars: move sdk toolchain selection from python block
Date: Mon, 5 Jun 2023 00:07:54 -0700 (PDT)	[thread overview]
Message-ID: <3f742bff-1ccd-4a88-8c96-8cab068b8eb4n@googlegroups.com> (raw)
In-Reply-To: <78f99600-592a-b3c3-7fee-791e2116abdf@siemens.com>


[-- Attachment #1.1: Type: text/plain, Size: 3347 bytes --]

Yes tested working fine, here i do the append overrides in downstream 
layer, like how the previous implementation before things move into the 
python block.

https://github.com/ilbers/isar/commit/43f402f4862c3779a492c50a26475ea1221a2b01

Now in present implementation comapt-arch override was removed and this 
selection of compat will be handled by  ISAR_ENABLE_COMPAT_ARCH 

Thanks,
Srinu

On Monday, June 5, 2023 at 12:31:01 PM UTC+5:30 Jan Kiszka wrote:

> On 04.06.23 11:32, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuv...@siemens.com>
> > 
> > In the present implementation we are not able to override the SDK
> > toolchain from downstream layer, this is due to the SDK toolchain
> > selection part in anonymous python function.
> > 
> > Anonymous python functions always run at the end of parsing, regardless 
> of where they are defined
> > even when we do override in our recipe, always wins the Anonymous Python
> > functions variable settings, hence we are not able to override our
> > downstream toolchain.
> > 
> > Move the SDK toolchian selection from python block, now we can able to
> > override from downstream layer.
> > 
> > Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
> > ---
> > meta/classes/crossvars.bbclass | 9 ++++-----
> > 1 file changed, 4 insertions(+), 5 deletions(-)
> > 
> > diff --git a/meta/classes/crossvars.bbclass 
> b/meta/classes/crossvars.bbclass
> > index 201d460..120e6d1 100644
> > --- a/meta/classes/crossvars.bbclass
> > +++ b/meta/classes/crossvars.bbclass
> > @@ -5,6 +5,10 @@ ISAR_CROSS_COMPILE ??= "0"
> > 
> > inherit compat
> > 
> > +SDK_TOOLCHAIN = "${@'build-essential' if d.getVar('ISAR_CROSS_COMPILE') 
> == '0' or d.getVar('HOST_ARCH') == d.getVar('DISTRO_ARCH') or 
> d.getVar('DISTRO_ARCH') == None else 'crossbuild-essential-${DISTRO_ARCH}'}"
> > +
> > +SDK_TOOLCHAIN:append = "${@' 
> crossbuild-essential-${COMPAT_DISTRO_ARCH}' if isar_can_build_compat(d) 
> else ''}"
> > +
>
> This is still no weak assignment which you will need for overrides. Did
> you actually test this? And, again, can't we implement the weak
> assignment in python below?
>
> Jan
>
> > python __anonymous() {
> > import pwd
> > d.setVar('SCHROOT_USER', pwd.getpwuid(os.geteuid()).pw_name)
> > @@ -17,19 +21,14 @@ python __anonymous() {
> > sbuild_dep = "sbuild-chroot-target:do_build"
> > buildchroot_dir = d.getVar('BUILDCHROOT_TARGET_DIR', False)
> > buildchroot_dep = "buildchroot-target:do_build"
> > - sdk_toolchain = "build-essential"
> > else:
> > d.setVar('BUILD_HOST_ARCH', d.getVar('HOST_ARCH'))
> > schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
> > sbuild_dep = "sbuild-chroot-host:do_build"
> > buildchroot_dir = d.getVar('BUILDCHROOT_HOST_DIR', False)
> > buildchroot_dep = "buildchroot-host:do_build"
> > - sdk_toolchain = "crossbuild-essential-" + distro_arch
> > d.setVar('SCHROOT_DIR', schroot_dir)
> > d.setVar('SCHROOT_DEP', sbuild_dep)
> > d.setVar('BUILDCHROOT_DIR', buildchroot_dir)
> > d.setVar('BUILDCHROOT_DEP', buildchroot_dep)
> > - if isar_can_build_compat(d):
> > - sdk_toolchain += " crossbuild-essential-" + 
> d.getVar('COMPAT_DISTRO_ARCH')
> > - d.setVar('SDK_TOOLCHAIN', sdk_toolchain)
> > }
>
> -- 
> Siemens AG, Technology
> Competence Center Embedded Linux
>
>

[-- Attachment #1.2: Type: text/html, Size: 5404 bytes --]

  reply	other threads:[~2023-06-05  7:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22  4:41 [PATCH] crossvars.bbclass: use d.appendVar instead of d.setVar for SDK_TOOLCHAIN variable Srinuvasan Arjunan
2023-05-22  5:16 ` Jan Kiszka
2023-05-22  5:54   ` Jan Kiszka
2023-05-25  4:53     ` Srinuvasan Arjunan
2023-05-25 10:20       ` Jan Kiszka
2023-05-26  9:03         ` Srinuvasan Arjunan
2023-06-04  9:32     ` [PATCH] meta/classes/crossvars: move sdk toolchain selection from python block Srinuvasan Arjunan
2023-06-05  7:00       ` Jan Kiszka
2023-06-05  7:07         ` Srinuvasan Arjunan [this message]
2023-06-05  7:18           ` Jan Kiszka
2023-06-05  7:43             ` Srinuvasan Arjunan

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=3f742bff-1ccd-4a88-8c96-8cab068b8eb4n@googlegroups.com \
    --to=srinuvasanasv@gmail.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