multilib_global.bbclass: fix setting preferred version for canadian recipes

Message ID 20220301081218.25469-1-Qi.Chen@windriver.com
State Accepted, archived
Commit ab8ed74082ffaf3b3adca84f4c41465f89657e76
Headers show
Series multilib_global.bbclass: fix setting preferred version for canadian recipes | expand

Commit Message

ChenQi March 1, 2022, 8:12 a.m. UTC
Currently the TRANSLATED_TARGET_ARCH is not changed when trying
to set preferred version for canadian recipes.

e.g.
```
bitbake core-image-minimal -c populate_sdk -e > env
grep ^PREFERRED_VERSION_gcc-cross-canadian env
```
The result is:
"""
PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
"""

We need to explictly change DEFAULTTUNE to ensure TRANSLATED_TARGET_ARCH is
changed when trying to set the preferred version for multilib version of
the canadian recipes.

e.g.
```
bitbake core-image-minimal -c populate_sdk -e > env
grep ^PREFERRED_VERSION_gcc-cross-canadian env
```
The result is:
"""
PREFERRED_VERSION_gcc-cross-canadian-i686="11.%"
PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
"""

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/multilib_global.bbclass | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Purdie March 2, 2022, 12:20 a.m. UTC | #1
On Tue, 2022-03-01 at 16:12 +0800, Chen Qi wrote:
> Currently the TRANSLATED_TARGET_ARCH is not changed when trying
> to set preferred version for canadian recipes.
> 
> e.g.
> ```
> bitbake core-image-minimal -c populate_sdk -e > env
> grep ^PREFERRED_VERSION_gcc-cross-canadian env
> ```
> The result is:
> """
> PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> """
> 
> We need to explictly change DEFAULTTUNE to ensure TRANSLATED_TARGET_ARCH is
> changed when trying to set the preferred version for multilib version of
> the canadian recipes.
> 
> e.g.
> ```
> bitbake core-image-minimal -c populate_sdk -e > env
> grep ^PREFERRED_VERSION_gcc-cross-canadian env
> ```
> The result is:
> """
> PREFERRED_VERSION_gcc-cross-canadian-i686="11.%"
> PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> """
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/classes/multilib_global.bbclass | 3 +++
>  1 file changed, 3 insertions(+)

This seems to break multilib builds:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/4844

Cheers,

Richard
ChenQi March 2, 2022, 1:59 a.m. UTC | #2
On 3/2/22 08:20, Richard Purdie wrote:
> On Tue, 2022-03-01 at 16:12 +0800, Chen Qi wrote:
>> Currently the TRANSLATED_TARGET_ARCH is not changed when trying
>> to set preferred version for canadian recipes.
>>
>> e.g.
>> ```
>> bitbake core-image-minimal -c populate_sdk -e > env
>> grep ^PREFERRED_VERSION_gcc-cross-canadian env
>> ```
>> The result is:
>> """
>> PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
>> """
>>
>> We need to explictly change DEFAULTTUNE to ensure TRANSLATED_TARGET_ARCH is
>> changed when trying to set the preferred version for multilib version of
>> the canadian recipes.
>>
>> e.g.
>> ```
>> bitbake core-image-minimal -c populate_sdk -e > env
>> grep ^PREFERRED_VERSION_gcc-cross-canadian env
>> ```
>> The result is:
>> """
>> PREFERRED_VERSION_gcc-cross-canadian-i686="11.%"
>> PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
>> """
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/classes/multilib_global.bbclass | 3 +++
>>   1 file changed, 3 insertions(+)
> This seems to break multilib builds:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/4844
>
> Cheers,
>
> Richard
>
Hi Richard and Ross,

I looked at the above failure. It's not caused by this patch. It's 
caused by the one below.

   package: do_package should depend on binutils

I could reproduce this problem by cherry-picking this commit to latest 
master branch. See detailed console output below.

chenqi@pek-lpg-core3:~/builds/build-poky-rm [2][0] $ bitbake 
lib32-core-image-minimal
Loading cache: 100% | | ETA:  --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% 
|#########################################################################################################################| 
Time: 0:00:26
Parsing of 843 .bb files complete (0 cached, 843 parsed). 2357 targets, 
116 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES 'virtual/i686-pokymllib32-linux-binutils'. Close 
matches:
   virtual/lib32-i686-pokymllib32-linux-binutils
   virtual/lib32-i686-pokymllib32-linux-rust
   virtual/x86_64-poky-linux-binutils
ERROR: Required build target 'lib32-core-image-minimal' has no buildable 
providers.
Missing or unbuildable dependency chain was: 
['lib32-core-image-minimal', 'lib32-qemuwrapper-cross', 
'virtual/i686-pokymllib32-linux-binutils']

Summary: There were 2 ERROR messages, returning a non-zero exit code.
chenqi@pek-lpg-core3:~/builds/build-poky-rm [2][0] $ cd -
/buildarea2/chenqi/poky
chenqi@pek-lpg-core3:~/poky [2][0] $ git log --oneline origin/master..HEAD
45d7a9a750 (HEAD -> master) package: do_package should depend on binutils

Regards,

Qi
Richard Purdie March 2, 2022, 11:17 a.m. UTC | #3
On Wed, 2022-03-02 at 09:59 +0800, ChenQi wrote:
> On 3/2/22 08:20, Richard Purdie wrote:
> > On Tue, 2022-03-01 at 16:12 +0800, Chen Qi wrote:
> > > Currently the TRANSLATED_TARGET_ARCH is not changed when trying
> > > to set preferred version for canadian recipes.
> > > 
> > > e.g.
> > > ```
> > > bitbake core-image-minimal -c populate_sdk -e > env
> > > grep ^PREFERRED_VERSION_gcc-cross-canadian env
> > > ```
> > > The result is:
> > > """
> > > PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> > > """
> > > 
> > > We need to explictly change DEFAULTTUNE to ensure TRANSLATED_TARGET_ARCH is
> > > changed when trying to set the preferred version for multilib version of
> > > the canadian recipes.
> > > 
> > > e.g.
> > > ```
> > > bitbake core-image-minimal -c populate_sdk -e > env
> > > grep ^PREFERRED_VERSION_gcc-cross-canadian env
> > > ```
> > > The result is:
> > > """
> > > PREFERRED_VERSION_gcc-cross-canadian-i686="11.%"
> > > PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> > > """
> > > 
> > > Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> > > ---
> > >   meta/classes/multilib_global.bbclass | 3 +++
> > >   1 file changed, 3 insertions(+)
> > This seems to break multilib builds:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/4844
> > 
> > Cheers,
> > 
> > Richard
> > 
> Hi Richard and Ross,
> 
> I looked at the above failure. It's not caused by this patch. It's 
> caused by the one below.
> 
>    package: do_package should depend on binutils
> 
> I could reproduce this problem by cherry-picking this commit to latest 
> master branch. See detailed console output below.

Sorry, it does look like it is Ross' change and not yours!

Ross: I think yours may also be causing the sstate sigs issue in:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3233/steps/14/logs/stdio

Cheers,

Richard
Alexander Kanavin March 2, 2022, 11:25 a.m. UTC | #4
Also, Ross, use HOST_PREFIX please (insert grumpy face  >:-|   ).

Alex

On Wed, 2 Mar 2022 at 12:18, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2022-03-02 at 09:59 +0800, ChenQi wrote:
> > On 3/2/22 08:20, Richard Purdie wrote:
> > > On Tue, 2022-03-01 at 16:12 +0800, Chen Qi wrote:
> > > > Currently the TRANSLATED_TARGET_ARCH is not changed when trying
> > > > to set preferred version for canadian recipes.
> > > >
> > > > e.g.
> > > > ```
> > > > bitbake core-image-minimal -c populate_sdk -e > env
> > > > grep ^PREFERRED_VERSION_gcc-cross-canadian env
> > > > ```
> > > > The result is:
> > > > """
> > > > PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> > > > """
> > > >
> > > > We need to explictly change DEFAULTTUNE to ensure TRANSLATED_TARGET_ARCH is
> > > > changed when trying to set the preferred version for multilib version of
> > > > the canadian recipes.
> > > >
> > > > e.g.
> > > > ```
> > > > bitbake core-image-minimal -c populate_sdk -e > env
> > > > grep ^PREFERRED_VERSION_gcc-cross-canadian env
> > > > ```
> > > > The result is:
> > > > """
> > > > PREFERRED_VERSION_gcc-cross-canadian-i686="11.%"
> > > > PREFERRED_VERSION_gcc-cross-canadian-x86-64="11.%"
> > > > """
> > > >
> > > > Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> > > > ---
> > > >   meta/classes/multilib_global.bbclass | 3 +++
> > > >   1 file changed, 3 insertions(+)
> > > This seems to break multilib builds:
> > >
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/4844
> > >
> > > Cheers,
> > >
> > > Richard
> > >
> > Hi Richard and Ross,
> >
> > I looked at the above failure. It's not caused by this patch. It's
> > caused by the one below.
> >
> >    package: do_package should depend on binutils
> >
> > I could reproduce this problem by cherry-picking this commit to latest
> > master branch. See detailed console output below.
>
> Sorry, it does look like it is Ross' change and not yours!
>
> Ross: I think yours may also be causing the sstate sigs issue in:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3233/steps/14/logs/stdio
>
> Cheers,
>
> Richard
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#162604): https://lists.openembedded.org/g/openembedded-core/message/162604
> Mute This Topic: https://lists.openembedded.org/mt/89471636/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Patch

diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index dae015cdaf..c77ca58997 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -39,6 +39,9 @@  def preferred_ml_updates(d):
                     override = ":virtclass-multilib-" + p
                     localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
                     if "-canadian-" in pkg:
+                        newtune = localdata.getVar("DEFAULTTUNE:" + "virtclass-multilib-" + p, False)
+                        if newtune:
+                            localdata.setVar("DEFAULTTUNE", newtune)
                         newname = localdata.expand(v)
                     else:
                         newname = localdata.expand(v).replace(version_str, version_str + p + '-')