diff mbox series

multilib.conf: explicitly make MULTILIB_VARIANTS vardeps on MULTILIBS

Message ID 20230727061521.3626071-1-Qi.Chen@windriver.com
State New
Headers show
Series multilib.conf: explicitly make MULTILIB_VARIANTS vardeps on MULTILIBS | expand

Commit Message

ChenQi July 27, 2023, 6:15 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

This patch is to ensure recipes get rebuilt correctly and avoid
incorrect sstate cache reuse when toggling multilib.

The following steps show one example of such incorrect sstate cache reuse.
1. enable multilib && bitbake <some_image> -c populate_sdk
2. disable multilib && bitbake <some_image> -c populate_sdk

The error message is as below:
Error:
 Problem: conflicting requests
   - nothing provides binutils-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
   - nothing provides gcc-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
   - nothing provides gdb-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
 (try to add '--skip-broken' to skip uninstallable packages)

We get this error because packagegroup-cross-canadian recipe is
not rebuilt when it should be.

Current codes have tracked the dependency to MULTILIB_VARIANTS, as
shown in the following chain:
RDEPENDS:packagegroup-cross-canadian-intel-x86-64 ->
all_multilib_tune_values -> MULTILIB_VARIANTS.

However, MULTILIB_VARIANTS cannot automatically depend on MULTILIBS.
See some results from 'bitbake-dumpsigs' below:
List of dependencies for variable MULTILIB_VARIANTS is ['extend_variants']
Variable MULTILIB_VARIANTS value is ${@extend_variants(d,'MULTILIBS','multilib')}

It's obvious that the value of MULTILIB_VARIANTS depend on the
value of MULTILIBS, so let's set this dependency manually.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/conf/multilib.conf | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Purdie July 28, 2023, 10:07 p.m. UTC | #1
On Thu, 2023-07-27 at 14:15 +0800, Chen Qi via lists.openembedded.org
wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> This patch is to ensure recipes get rebuilt correctly and avoid
> incorrect sstate cache reuse when toggling multilib.
> 
> The following steps show one example of such incorrect sstate cache reuse.
> 1. enable multilib && bitbake <some_image> -c populate_sdk
> 2. disable multilib && bitbake <some_image> -c populate_sdk
> 
> The error message is as below:
> Error:
>  Problem: conflicting requests
>    - nothing provides binutils-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>    - nothing provides gcc-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>    - nothing provides gdb-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>  (try to add '--skip-broken' to skip uninstallable packages)
> 
> We get this error because packagegroup-cross-canadian recipe is
> not rebuilt when it should be.
> 
> Current codes have tracked the dependency to MULTILIB_VARIANTS, as
> shown in the following chain:
> RDEPENDS:packagegroup-cross-canadian-intel-x86-64 ->
> all_multilib_tune_values -> MULTILIB_VARIANTS.
> 
> However, MULTILIB_VARIANTS cannot automatically depend on MULTILIBS.
> See some results from 'bitbake-dumpsigs' below:
> List of dependencies for variable MULTILIB_VARIANTS is ['extend_variants']
> Variable MULTILIB_VARIANTS value is ${@extend_variants(d,'MULTILIBS','multilib')}
> 
> It's obvious that the value of MULTILIB_VARIANTS depend on the
> value of MULTILIBS, so let's set this dependency manually.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/conf/multilib.conf | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf
> index 7f3b9463ef..ef3605a73d 100644
> --- a/meta/conf/multilib.conf
> +++ b/meta/conf/multilib.conf
> @@ -2,6 +2,7 @@
>  baselib = "${@d.getVar('BASE_LIB:tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}"
>  
>  MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
> +MULTILIB_VARIANTS[vardeps] += "MULTILIBS"
>  MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
>  
>  MULTILIBS ??= "multilib:lib32"

I suspect this resulted in this selftest failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5534/steps/15/logs/stdio

Cheers,

Richard
ChenQi July 31, 2023, 2:13 a.m. UTC | #2
Got it. I'll check this failure.

Regards,
Qi

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Saturday, July 29, 2023 6:08 AM
To: Chen, Qi <Qi.Chen@windriver.com>; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] multilib.conf: explicitly make MULTILIB_VARIANTS vardeps on MULTILIBS

On Thu, 2023-07-27 at 14:15 +0800, Chen Qi via lists.openembedded.org
wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
> 
> This patch is to ensure recipes get rebuilt correctly and avoid 
> incorrect sstate cache reuse when toggling multilib.
> 
> The following steps show one example of such incorrect sstate cache reuse.
> 1. enable multilib && bitbake <some_image> -c populate_sdk 2. disable 
> multilib && bitbake <some_image> -c populate_sdk
> 
> The error message is as below:
> Error:
>  Problem: conflicting requests
>    - nothing provides binutils-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>    - nothing provides gcc-cross-canadian-i686 needed by packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>    - nothing provides gdb-cross-canadian-i686 needed by 
> packagegroup-cross-canadian-intel-x86-64-1.0-r0.x86_64_nativesdk
>  (try to add '--skip-broken' to skip uninstallable packages)
> 
> We get this error because packagegroup-cross-canadian recipe is not 
> rebuilt when it should be.
> 
> Current codes have tracked the dependency to MULTILIB_VARIANTS, as 
> shown in the following chain:
> RDEPENDS:packagegroup-cross-canadian-intel-x86-64 -> 
> all_multilib_tune_values -> MULTILIB_VARIANTS.
> 
> However, MULTILIB_VARIANTS cannot automatically depend on MULTILIBS.
> See some results from 'bitbake-dumpsigs' below:
> List of dependencies for variable MULTILIB_VARIANTS is 
> ['extend_variants'] Variable MULTILIB_VARIANTS value is 
> ${@extend_variants(d,'MULTILIBS','multilib')}
> 
> It's obvious that the value of MULTILIB_VARIANTS depend on the value 
> of MULTILIBS, so let's set this dependency manually.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/conf/multilib.conf | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf index 
> 7f3b9463ef..ef3605a73d 100644
> --- a/meta/conf/multilib.conf
> +++ b/meta/conf/multilib.conf
> @@ -2,6 +2,7 @@
>  baselib = "${@d.getVar('BASE_LIB:tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}"
>  
>  MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
> +MULTILIB_VARIANTS[vardeps] += "MULTILIBS"
>  MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
>  
>  MULTILIBS ??= "multilib:lib32"

I suspect this resulted in this selftest failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5534/steps/15/logs/stdio

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf
index 7f3b9463ef..ef3605a73d 100644
--- a/meta/conf/multilib.conf
+++ b/meta/conf/multilib.conf
@@ -2,6 +2,7 @@ 
 baselib = "${@d.getVar('BASE_LIB:tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}"
 
 MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
+MULTILIB_VARIANTS[vardeps] += "MULTILIBS"
 MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
 
 MULTILIBS ??= "multilib:lib32"