diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2025-02-24 22:48:53 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-06 16:32:47 +0000 |
commit | b34f84dce855a149a465159e09161ff7a79e65c5 (patch) | |
tree | 0a5773219c30f7eb8c8a2270e42cf51feeefe4d6 /bitbake | |
parent | c077a12e49029a6873d36ed25fbedb36a35505be (diff) | |
download | poky-b34f84dce855a149a465159e09161ff7a79e65c5.tar.gz |
bitbake: data_smart.py: clear expand_cache in _setvar_update_overridevars
At the end of this function, self.overrides is cleared, which means we'll
construct a new self.overrides after this call. And a new self.overrides
will give out different expand_cache, so the old expand_cache should also
be cleared to avoid any wrong value.
Currently, there's a problem revealed by recent recipe specific virtual
provider patch. If we enable multilib and set "OVERRIDES:prepend" in local.conf,
things don't work.
Here's the error message:
ERROR: Nothing PROVIDES 'lib32-gcc-cross-x86_64'
Below are reproduce steps:
1. Add in local.conf the following lines:
MACHINE ?= "qemux86-64"
require conf/multilib.conf
MULTILIBS ?= "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 ?= "core2-32"
OVERRIDES:prepend = "some-override:"
(Note that using :append and :remove also reproduces the issue.)
2. bitbake -n lib32-sysstat
(bitbake -n core-image-minimal also reproduces the issue)
The expandWithRefs calls getVar, which fills expand_cache. So when setting
OVERRIDES:prepend, this will fill the expand_cache. When overridevars are updated,
if we don't clear expand_cache, we'll retrieve wrong values.
Previously, things happened to work because there's a call to expand
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc, which in turn expands
TARGET_VENDOR. Now what we expand is PREFERRED_PROVIDER_ virtual/cross-cc,
so the problem is revealed.
(Bitbake rev: 842e94234c9b9faf4e902721f516071f643e49c9)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 77a3fd602f..360068fd0a 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -636,6 +636,7 @@ class DataSmart(MutableMapping): | |||
636 | nextnew.update(vardata.contains.keys()) | 636 | nextnew.update(vardata.contains.keys()) |
637 | new = nextnew | 637 | new = nextnew |
638 | self.overrides = None | 638 | self.overrides = None |
639 | self.expand_cache = {} | ||
639 | 640 | ||
640 | def _setvar_update_overrides(self, var, **loginfo): | 641 | def _setvar_update_overrides(self, var, **loginfo): |
641 | # aka pay the cookie monster | 642 | # aka pay the cookie monster |