multilib.conf: explicitly make MULTILIB_VARIANTS vardeps on MULTILIBS
PATCH v2 1/2 multilib.conf: explicitly make MULTILIB_VARIANTS vardeps on MULTILIBS
From: Chen Qi <[email protected]>
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.
--- meta/conf/multilib.conf | 1 + 1 file changed, 1 insertion(+)
meta/conf/multilib.conf +1 -0
@@ -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"
Signature · 1 line
2.34.1
PATCH v2 2/2 gcc-crosssdk: ignore MULTILIB_VARIANTS in signature computation
From: Chen Qi <[email protected]>
The gcc_multilib_setup function is a function that is run at the do_configure step, so it's counted into the signature computation. The MULTILIB_VARIANTS this function uses is also extracted to be taken into consideration. After the change of setting MULTILIB_VARIANTS explictly vardeps on MULTILIBS, the change of MULTILIBS changes the signature, thus causing rebuilding. However, in case of gcc-crosssdk, the setting of multilib should have no effect on it, as it's used to build nativesdk packages, not the target packages. So ignore MULTILIB_VARIANTS in signature computation. This fixes oe-selftest case sstatetests.SStateHashSameSigs2.test_sstate_nativesdk_samesigs_multilib.
--- meta/recipes-devtools/gcc/gcc-crosssdk.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-devtools/gcc/gcc-crosssdk.inc +2 -0
@@ -10,3 +10,5 @@ GCCMULTILIB = "--disable-multilib" DEPENDS = "virtual/${TARGET_PREFIX}binutils gettext-native ${NATIVEDEPS}" PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" + +gcc_multilib_setup[vardepsexclude] = "MULTILIB_VARIANTS"
Signature · 1 line
2.34.1